Closed Bug 1455066 Opened 7 years ago Closed 5 years ago

Firefox exposes ARIA grids with extra divs incorrectly

Categories

(Core :: Disability Access APIs, defect, P2)

59 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: dmazzoni, Assigned: MarcoZ)

References

(Blocks 1 open bug)

Details

(Keywords: parity-chrome)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36 Steps to reproduce: Load the following snippet into Firefox Windows and then inspect the output using an accessibility debugging tool. <div role="grid"> <div role="row"> <div role="gridcell">Normal cell</div> <div role="gridcell">1</div> </div> <div role="row"> <div role="gridcell">Div</div> <div><div role="gridcell">2</div></div> </div> </div> Firefox is not treating the last gridcell as part of the table because of the extra wrapping <div>. One easy thing to verify is that the IA2 attribute "table-cell-index" is not exposed at all on that cell. It also seems to expose the wrong table-cell-index on the previous cell either, but I'm not sure if that's related. I believe it's also not exposing all of the IAccessibleTableCell properties correctly either, but table-cell-index being missing was my first clue. Note that if you wrap it in a <span> or <p> it works fine. Finally, I've seen this pattern in the wild - Amazon's result pages contain some ARIA grids that have extra wrapping <div> elements between the row and the grid elements.
Component: Untriaged → Layout
Product: Firefox → Core
Not sure if this is a layout issue or a debugging issue. Please correct if it's the latter case.
It is accessibility bug, so moving it to a proper component. HTML:div has an accessible object in Firefox, and thus it appears in the accessible hierarchy. You may argue it shouldn't be accessible, and it will be a fix for the bug. Otherwise it doesn't look like a valid ARIA grid hierarchy, and thus it has to seen as author error. Does ARIA say something about such cases? Are you sure it works fine for HTML:p? It shouldn't be different from HTML:div.
Status: UNCONFIRMED → NEW
Component: Layout → Disability Access APIs
Ever confirmed: true
Priority: -- → P3

This breaks even harder if there is a div between a grid and its rows:
data:text/html,before<div role="grid" aria-readonly="true"><div tabindex="-1"><div role="row"><div role="gridcell">cell content</div></div></div></div>
This results in a table with 0 rows and 0 columns and table navigation fails. This breaks real world usage in web apps such as SharePoint and SAP Net Viewer. Works as expected in Chrome.

The spec notes that required owned elements (row is a required owned element of grid) can be descendants, not just children:

Any element that will be owned by the element with this role. For example, an element with the role list will own at least one element with the role listitem.

https://w3c.github.io/aria/#mustContain

An 'owned element' is any DOM descendant of the element, any element specified as a child via aria-owns, or any DOM descendant of the owned child.

https://w3c.github.io/aria/#terms

IMO, this vagueness around descendant is problematic. For example, what if the intervening div had a role of button or cell? However, the reality is that our current behaviour is breaking real world use cases. Maybe we could ignore intervening generic HyperTextAccessibles with non-presentation ARIA roles?

Priority: P3 → P2
See Also: → 1619383

When looking to see if a row has a table, now also include section role accessibles in addition to row groups.

Also, when iterating through rows from a table, take into account that rows may be wrapped in section role accessibles.

Assignee: nobody → mzehe
Status: NEW → ASSIGNED
Pushed by mzehe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f80d7f8cf8f9 Take into account wrapping div or section elements when calculating table indexes for grid rows, r=Jamie
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
Regressions: 1626137
Blocks: 1723195
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: