Files
tubestation/accessible/tests/mochitest
James Teh dc02759a3b Bug 1926541 part 2: Change the getAccessibleDOMNodeID test harness functions to simply use the id property. r=morgan
This keeps id retrieval code in one place: the accessibility engine.
It thus fixes some edge cases that were previously broken; e.g. SVG documents.
It would have been nice to remove these functions altogether and have everything use the id property directly.
Unfortunately, some code depends on getAccessibleDOMNodeID returning null when an accessible has died, rather than throwing an exception.
Changing all the impacted callers to catch exceptions is a bit ugly, but having the XPCOM function just return null itself in this case seemed like hiding reality.
This way, callers have a choice: they can use the id property directly if they care about the failure case (or if the failure case isn't relevant for their use case), or they can call getAccessibleDOMNodeID if they explicitly want to ignore the failure.

It turns out that some tests were unwittingly relying on the nsIAccessibleDocument interface having been queried on the document accessible by getAccessibleDOMNodeID when waiting for the doc load complete event.
To fix this, the harness now explicitly queries for nsIAccessibleDocument before passing the document to test tasks.

Differential Revision: https://phabricator.services.mozilla.com/D244708
2025-04-10 00:41:26 +00:00
..