Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with empty link elements #48

Closed
nvaccessAuto opened this issue Jan 1, 2010 · 3 comments
Closed

Problems with empty link elements #48

nvaccessAuto opened this issue Jan 1, 2010 · 3 comments

Comments

@nvaccessAuto
Copy link

Reported by jteh on 2008-03-18 23:15
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.

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

@nvaccessAuto
Copy link
Author

Attachment empty_links.html added by jteh on 2008-03-18 23:15
Description:
Test case.

@nvaccessAuto
Copy link
Author

Comment 1 by jteh on 2008-03-18 23:19
Changes:
Milestone changed from None to 0.6

@nvaccessAuto
Copy link
Author

Comment 2 by jteh on 2008-03-19 12:59
Actually, the fix was a lot simpler than initially thought. The reason that empty links are not rendered into the buffer is that they are invisible and invisible nodes are not rendered into the buffer. They are still represented as nodes, but they have no text; they have 0 length. Thus, the correct fix is to ignore invisible nodes when searching for nodes, as implemented in r1846. Some bounds checking should perhaps be added to the storage library to prevent crashes, but this is a different issue.
Changes:
State: closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant