Closed Bug 1772042 Opened 3 years ago Closed 3 years ago

Don't recreate accessible when an ancestor becomes visibility: hidden

Categories

(Core :: Disability Access APIs, enhancement)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1638713

People

(Reporter: Jamie, Unassigned)

References

Details

STR:

  1. Open this test case:
    data:text/html,<div id="a" title="a"><p id="b" style="visibility: visible;">p</p><button onclick="a.style.visibility = 'hidden';">hide a
  2. Get the Accessible for "p".
  3. Press the "hide a" button.
  4. Get the Accessible for "p".
    • Expected: The Accessibles should be the same (no re-creation).
    • Actual: The Accessible is different to that retrieved in step 2 (re-creation).

Bug 686400 prevented layout frame reconstruction from re-creating Accessibles. However, we still re-create in the CSS visibility case.

This occurs because layout explicitly removes visibility: hidden elements from the a11y tree. A11y still needs to be notified about these changes, but we should use our PruneOrInsertSubtree code to figure out what to do with them, rather than removing them unconditionally.

We can probably fix this by having RestyleManager call a11y's ContentRangeInserted notification rather than ContentRemoved. The naming is weird, though.

Blah. Making the change in RestyleManager doesn't help because PruneOrInsertSubtree can't actually handle removing an ancestor while still keeping descendants. It calls ContentRemoved itself, and even though we then walk the subtree to reinsert nodes, they're already detached at that point (no longer in mNodeToAccessibleMap because of UncacheChildrenInSubtree), so nothing gets reused.

We'd need to find some way to fix this in PruneOrInsertSubtree first.

Apparently past me already filed this exact bug and forgot about it.

Status: NEW → RESOLVED
Closed: 3 years ago
Duplicate of bug: 1638713
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.