Closed Bug 1864357 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 43100 - Revert "[A11y] Do not allow asymmetrical parent-child relations in tree"

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox122 fixed)

RESOLVED FIXED
122 Branch
Tracking Status
firefox122 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 43100 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/43100
Details from upstream follow.

Aaron Leventhal <aleventhal@chromium.org> wrote:

Revert "[A11y] Do not allow asymmetrical parent-child relations in tree"

This reverts commit 0953e5a0ef7748af2c932568ec9d9bbdbc480f11.

Reason for revert: bug 1501535 (crashes on google.com when a11y active)

Original change's description:

[A11y] Do not allow asymmetrical parent-child relations in tree

Design doc:
https://docs.google.com/document/d/1PnjhlWqTtivmsUVTF0kqMAUIsO9a_eTp32pRY4KJh_U/edit#heading=h.wlgzk7gh4m76

Fix failures brought to light by the Eager AX Tree Updates project and related checks, so that serialization operates on a truly frozen, complete AX Tree, and does not lead to changes to the underlying data at unsafe times. After landing this CL and any follow-ups, the goal is to have a vastly more stable, predictable Blink accessibility engine.

The current implementation can lead to processing the tree when there
are "holes" in the data structure, such as missing parents or children,
which can lead to crashes, checks and unpredictability.

  1. Avoid holes in the first place: do not call AXObject::ClearChildren() immediately when calling AXObject::SetNeedsToUpdateChildren(), so that missing parent and missing child holes are not created for unchanged siblings. These holes tended to sit around and cause problems when downstream operations did not expect them. Only call ClearChildren() right before rebuilding the children, in UpdateChildrenIfNecessary().
  2. More complete repairs: Instead of only repairing missing parents, when a parentless ensure a complete subtree structure around the child, starting with the included parent. The new method to accomplish this is called AXObjectCacheImpl::RepairIncludedParentsChildren(). It makes sure that every parent up to the included parent has a complete set of children.
  3. More timely repairs: instead of waiting for a hole to be discovered while tree walking, eagerly ensure that objects up to their included parent have repairs, whenever an object is being retrieved for deferred event processing, or when an object is being created in the middle of a tree. If the necessary parents do not exist, and thus the AXObject itself is not viable, make sure any stale AXObjects in that subtree are eagerly removed, because they are also not viable.
  4. More complete tree structure checks in AXObjectCacheImpl::CheckTreeIsUpdated(), which ensure symmetrical included parent-child relationships are complete. This helps guarantee that no lazy computations try to alter the tree while it’s being serialized (in a frozen state). The new checks do not pass without the other code changes, which are in service of the new checks.

Future work: attempt to avoid any tree repairs and guarantee completeness in more places, providing even more predictability, for example, by handling CSS display changes similarly to role changes.

Fixed: 1422755,1483877,1482591,1481940,1480442,1488246,1486249,1484029,1353205,1480627,1480429,1494849,1493953,1484394,1489027,1491163
Change-Id: Ied4258680ffe4099caaf4c5e614c59c70c61a013
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4873421
Reviewed-by: Chris Harrelson \<chrishtr@chromium.org>
Commit-Queue: Aaron Leventhal \<aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1223164}

Change-Id: I33d7aab81edacb151cadffeee0969df4591bd947

Reviewed-on: https://chromium-review.googlesource.com/5021416
WPT-Export-Revision: 32239f2ff266acdb2e5d1bc899d612f775b15d95

PR 43100 applied with additional changes from upstream: 4bb789f7548f791710ff811d5ce28c46c1605cbe
The PR was not expected to affect any tests, but the try push wasn't a success. Check the try results for infrastructure issues
The PR was not expected to affect any tests, but the try push wasn't a success. Check the try results for infrastructure issues
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a5917a67afcb [wpt PR 43100] - Revert "[A11y] Do not allow asymmetrical parent-child relations in tree", a=testonly
Test result changes from PR not available.
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/876cd9382d18 [wpt PR 43100] - Revert "[A11y] Do not allow asymmetrical parent-child relations in tree", a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 122 Branch
You need to log in before you can comment on or make changes to this bug.