Ticket #48 (closed defect: fixed)
Problems with empty link elements
| Reported by: | jteh | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 0.6 |
| Component: | Virtual buffers | Version: | trunk |
| Keywords: | Cc: | ||
| Blocking: | Blocked By: |
Description
It is possible to have a link with no content, like so:
<a href="#"></a>
This is pretty silly, but it is nevertheless possible and you can actually tab to such a link.
Unfortunately, the gecko_ia2 backend does not render these empty link objects into the text at all; i.e. they have a length of 0 characters. This causes two problems:
- The user cannot access the link by cursoring in the virtual buffer, but pressing k before the link will jump to the supposed start location of the link and say "blank".
- If the last rendered element in a document is an empty link, links list will cause a crash in Firefox and a lockup in NVDA.
- This is because the start offset is actually one past the end of the buffer. When the iterator tries to check for a further link, it passes this invalid offset to the buffer and causes a crash.
- The iterator could perform bounds checking to ensure this doesn't happen, but I'm wondering whether this should be done in storage to prevent similar crashes.
- This is because the start offset is actually one past the end of the buffer. When the iterator tries to check for a further link, it passes this invalid offset to the buffer and causes a crash.
Proposed Solutions
- The gecko_ia2 backend could expose empty links as a single space character, similar to the way other empty elements such as graphics and checkboxes are exposed. I think this is the preferred solution.
- The NVDA code to jump to links and the node iterator could ignore 0 length nodes. This would also require the bounds checking described above, either in NVDA or storage.
Test Cases
- See attachment; causes links list crash.
- http://www.gennarino.org/forum; causes links list crash.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

NVDA is supported by