New issue
Advanced search Search tips
Starred by 1 user
Status: Fixed
Owner: ----
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug
Team-Accessibility



Sign in to add a comment
IAccessible::get_accChild on sub-documents should only return descendants
Project Member Reported by ja...@nvaccess.org, Mar 18 2016 Back to list
Version: 51.0.2680.0 canary (64-bit)
OS: Windows 10 64-bit

STR:
1. Start NVDA.
2. Open the attached test case in Chrome.
3. Tab once to "A link in the root doc".
4. Tab again to "A link in the sub-doc".
5. Shift+tab back to "A link in the root doc".
6. Press control+page up to move the browse mode cursor to the top of the document.
Expected: NVDA should say "This is the root doc."
Actual: It sometimes says "This is the sub-doc."
Note: This is intermittent because the data structure in which NVDA tracks documents is an unordered set. If you get the expected result, refresh and repeat from step 1. You may need to do this several times.

In NVDA, sub-documents like this are rendered separately from the root document. When focus is in the sub-document, the browse mode cursor should be "trapped" inside it. In order to determine which document to use when handling an event, NVDA needs to be able to quickly determine whether the event object is inside a given document.

It does this by calling IAccessible::get_accChild on the document, passing the id of the event object. If the call succeeds, the object is inside the document. If it fails, it isn't.

Unfortunately, with the above example in Chrome, calling IAccessible::get_accChild on the sub-document passing the id of "A link in the root doc" succeeds. That is, even though the link is an ancestor of the sub-document (not a descendant), it still succeeds.

A way to work around this is to crawl the ancestors for every event. However, this can be extremely expensive with deep hierarchies for out-of-process queries such as NVDA uses here.

Note that Firefox does implement get_accChild in this manner.

It's worth noting that as an optimisation, this does not need to work as described here for *all* objects. We only use this to test for descendants in documents. This includes HTML body elements, as well as nodes with an ARIA role of document, application or dialog. (The latter two are needed because users sometimes want to reat an ARIA dialog/application as a document, mostly due to poor authoring.)

Impact: NVDA users can't reliably use sites that use ARIA dialogs/sub-documents. twitter.com is one good example.

Related NVDA issue: https://github.com/nvaccess/nvda/issues/5818
 
subdoc.html
304 bytes View Download
This makes sense. To express this a different way, if you call get_accChild and pass it a unique ID of a node, you only want it to return that node if it's a direct descendant of the object it was called on.

And to clarify, if the id you pass to get_accChild is a child of a sub-document, it should still return it, as long as it's a descendant, right?

Comment 2 by ja...@nvaccess.org, Mar 18 2016
Correct. And yes, asking a parent document for the descendant of a 
sub-document should succeed.
Comment 4 by nek...@chromium.org, Mar 18 2016
Status: Fixed
Sign in to add a comment