Closed Bug 1668707 Opened 4 years ago Closed 4 years ago

divs not pruned from the a11y tree if their first or last child is an invisible text node

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

RESOLVED FIXED
83 Branch
Tracking Status
firefox83 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

Details

Attachments

(1 file)

In bug 646216, we prevented Accessibles for being created for divs where there is no value for a11y. One case where we do create an Accessible is if the div has a text node as its first or last child. The problem is that text nodes can be created in the DOM just because there was white space in the source. For example:

data:text/html,<div> <p>test</p> </div>

The space before and after the paragraph creates a text node in the DOM, but this isn't visible when rendered by layout. However, we still create an Accessible for the div. If you remove the spaces, we don't create an Accessible.

We should additionally check that the text node is visible; i.e. whether it has a frame.

This is causing extraneous section Accessibles to be created in Searchfox where there are sticky lines; e.g. namespaces. That in turn is triggering a table a11y bug with intervening divs. See bug 1668701.

Text nodes can be created in the DOM just because there was white space in the source, but this isn't always visible.
We shouldn't create an Accessible in the invisible case.
However, there could be an inline frame after/before an invisible text node, so we still need to check for that.

Attachment #9179163 - Attachment description: Bug 1668707: Don't create Accessibles for divs based on first/last child text node if it's invisible. → Bug 1668707: When deciding whether to create a div Accessible, skip the first/last child if it's invisible and consider inline-block, etc.
Pushed by mzehe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/98a054d166c3
When deciding whether to create a div Accessible, skip the first/last child if it's invisible and consider inline-block, etc. r=MarcoZ
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 83 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: