Closed Bug 1816346 Opened 1 year ago Closed 1 year ago

[CTW] Deal with unintended semantics due to role="presentation" being overridden by transforms or position: fixed/sticky

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

RESOLVED FIXED
112 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox110 --- unaffected
firefox111 --- fixed
firefox112 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [ctw-m5])

Attachments

(2 files)

In bug 1806356 and bug 1814800, we forced the creation of Accessibles for elements with transforms and position: fixed/sticky. This was necessary for the cache. This is fine for generic elements like divs and spans, since clients already have to ignore those in many cases. However, it's not great for elements with semantics like tables. For example:

data:text/html,<table style="position: sticky;" role="presentation"><tr><th>test

This table will be exposed as a table in the a11y tree, even though it has role="presentation". In contrast, if you remove the styling, role="presentation" applies as expected and the table is exposed as generic Accessibles.

Note that focusability and global ARIA attributes have always completely overridden role="presentation" and preserved their semantics. However, that is specified behaviour and should remain as is.

There are a couple of ways we could fix this problem with Accessibles forced by styling:

  1. Expose these forced Accessibles with generic roles. This would require us to differentiate between cases where we absolutely should override role="presentation" and cases where we just need a generic Accessible. That is, we'd need to split up MustBeAccessible or have it return different answers for these two cases.
  2. Support ignored children in the core tree. This would require us to cache the ignored child count at least. It also adds another layer of complexity, given that we already have ignored children on Mac.
    • We could try to move most of Mac's ignored children logic into the core tree. However, each platform would need to be able to extend the rules for whether something is ignored or not. That would mean the core tree would have some different data on different platforms, which doesn't seem great. ON the other hand, it avoids duplication this logic.
Assignee: nobody → jteh

Otherwise, semantics are exposed (e.g. for a table), which completely defeats the author's intent that this be treated as presentational.

For the record, we discussed the ignored children approach. Even if we did that (and we may still do so later), we would have needed the generic Accessibles patch anyway. Otherwise, even though the table would have been ignored, we would have exposed table rows and cells.

Attachment #9318337 - Attachment description: Bug 1816346: If we force an Accessible to be created due to transform/fixed/sticky despite it being presentational, make it a generic Accessible. → Bug 1816346 part 2: If we force an Accessible to be created due to transform/fixed/sticky despite it being presentational, make it a generic Accessible.

Previously, the test was retrieving an Accessible with a non-existent id and calling testAccessibleTree on it.
That meant we were calling testAccessibleTree with null, which is a no-op.
Now, we get the intended Accessible so that the test actually tests what it was supposed to test.
This is important to test a potential bug in the next patch.

Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/22b32e106152
part 1: Fix the transform tree creation test in browser_test_simple_transform.js. r=nlapre
https://hg.mozilla.org/integration/autoland/rev/eeb78c17513c
part 2: If we force an Accessible to be created due to transform/fixed/sticky despite it being presentational, make it a generic Accessible. r=nlapre
Regressed by: 1806356
Keywords: regression

Set release status flags based on info from the regressing bug 1806356

Flags: needinfo?(jteh)
Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/daddc9682f04
part 1: Fix the transform tree creation test in browser_test_simple_transform.js. r=nlapre
https://hg.mozilla.org/integration/autoland/rev/7ce58b734414
part 2: If we force an Accessible to be created due to transform/fixed/sticky despite it being presentational, make it a generic Accessible. r=nlapre
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
Whiteboard: [ctw-m5]

Comment on attachment 9318337 [details]
Bug 1816346 part 2: If we force an Accessible to be created due to transform/fixed/sticky despite it being presentational, make it a generic Accessible.

Beta/Release Uplift Approval Request

  • User impact if declined: Some elements (e.g. tables) marked as presentational might be incorrectly exposed to screen reader users.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Covered by automated tests. Only impacts accessibility exposure of elements in specific cases.
  • String changes made/needed:
  • Is Android affected?: Yes
Attachment #9318337 - Flags: approval-mozilla-beta?
Attachment #9318643 - Flags: approval-mozilla-beta?

Comment on attachment 9318337 [details]
Bug 1816346 part 2: If we force an Accessible to be created due to transform/fixed/sticky despite it being presentational, make it a generic Accessible.

Approved for 111.0b5

Attachment #9318337 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Comment on attachment 9318643 [details]
Bug 1816346 part 1: Fix the transform tree creation test in browser_test_simple_transform.js.

Approved for 111.0b5

Attachment #9318643 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: