Open Bug 1703426 Opened 3 years ago Updated 3 years ago

Iframe DocAccessible might not be created for iframe in shadow DOM

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

People

(Reporter: Jamie, Unassigned)

References

(Blocks 1 open bug)

Details

STR:

  1. Start Firefox without accessibility being enabled (e.g. no accessibility client).
  2. Open this test case:
    data:text/html,
    <div id="host"></div>
    <script>
    let shadow = host.attachShadow({mode: "open"});
    shadow.innerHTML = '<iframe src="https://google.com/notfound"></iframe>';
    </script>
    
  3. Right click the document and choose "Inspect Accessibility Properties".
  4. In the accessibility tree, expand everything.
    • Expected: There should be a "document" inside the "internal frame".
    • Actual: There is nothing inside the "internal frame".

This happens because OuterDocAccessible calls GetUncomposedDoc when ensuring DocAccessible creation, but the uncomposed doc will be null for an iframe inside shadow DOM. This should be GetComposedDoc.

While this is a trivial fix, it's difficult to test because this bug will only happen if the DocAccessible wasn't created some other way. Normally, it is created some other way; e.g. layout notification, DOM load notification, etc. So, the only reliable way to test this is to load the document before the acc service is started and then perform the test once it starts. That's going to be difficult to write in a test, though we do have some existing tests which mess with service creation/shutdown.

Marking as s4 because iframes inside shadow DOM are (probably?) rare and because most a11y users that crawl the whole tree will have the client running before Firefox starts.

Summary: Iframe document might not be created for iframe in shadow DOM → Iframe DocAccessible might not be created for iframe in shadow DOM
You need to log in before you can comment on or make changes to this bug.