After CL:4185636, an AXObject may have been detached and recreated
with the same DOM node, and therefore has the same id (the dom node id).
This breaks the accessibility object caching mechanism used for web
tests, which assumes that if it sees the same ID, it can assume the
object is still the same one. The fix is to notify the caching
mechanism of detached AXObjects so that it can invalidate the
corresponding entries.
Bug: none
Change-Id: I152538644f9dc24d4e7fbfe68057deb4ab4d34aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5262560
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1256301}
Use AXMode instead of setting. The setting was redundant, but it
also did not propagate to the child popup document.
As a beneficial side effect, the popover document now has the same
inline text box support as the main document.
This CL also contains all the unit test changes necessary for part 3,
where it is will only be allowed to create inline text boxes
when processing deferred events.
Bug: none
Change-Id: If2be827e36dee6a6ccb88cfe7f7bc62c070d01ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4919417
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1207322}
This is a reland of CL:3964415 and supporting CLs, which
were reverted together with a number of supporting CLs,
in CL:3990067 because of crbug.com/1376991. The problematic code
is fixed in CL:3988990. Also fixes a flake in week pickers
reported in bug 1378062.
A11y is moved to the end of the document lifecycle, where it can
occur in parallel with other tasks.
Parts of the code that used to force layout updates in order to
update the AX tree now call UpdateAXForAllDocuments(), a new
method introduced in the previous CL, which first updates the
lifecycle and then manually updates the AX tree.
Additional code cleanups in AXObjectCacheImpl related to
popups were also now possible.
Test changes:
* Changes to css-display-expected-win.txt and content-editable-notifications.html were due to a subtle change in event ordering,
but are still correct.
Fixed: 1378062,1376991
NOTRY: true
Change-Id: I7fa925e12cfb7352cbaf9c2deed4b83e47ae084d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3991106
Commit-Queue: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Benjamin Beaudry <benjamin.beaudry@microsoft.com>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1064998}
It is not practical to revert each CL individually, so I have
created this CL to bundle all the reverts together.
da5d2ffb6d4463d9a99f2278ce249c97778ef77827716a230a76b1d09313faed33fe9014c61afb23962d5db870b18739d1154066dd6c1c
crrev.com/c/3964415
crrev.com/c/3970603
crrev.com/c/3974832
crrev.com/c/3976209
crrev.com/c/3971173
crrev.com/c/3972090
crrev.com/c/3970627
crrev.com/c/3970885
crrev.com/c/3976391
crrev.com/c/3978892
crrev.com/c/3975164
Revert "Move a11y to post-lifecycle steps (iteration #4)"
This reverts commit da5d2ffb6d.
Revert "AXObjectCache is still dirty if tree updates are paused"
This reverts commit 4463d9a99f.
Revert "Remove extra call to ProcessDeferredAccessibilityEvents()"
This reverts commit 2278ce249c.
Revert "More robust handling of aria-activedescendant invalidations"
This reverts commit 97778ef778.
Revert "Avoid redundant calls to UpdateAXForAllDocuments()"
This reverts commit 27716a230a.
Revert "Restore popup guard"
This reverts commit 76b1d09313.
Revert "Use DCHECKs to prevent recursive calls in AXObjectCacheImpl"
This reverts commit faed33fe90.
Revert "Avoid raw pointer in WebAXObjectProxyList"
This reverts commit 14c61afb23.
Revert "Clean up load logic so that it's easier to understand"
This reverts commit 962d5db870.
Revert "Deflake web tests that create the root ax object"
This reverts commit b18739d115.
Revert "Do not create orphaned AXObjects for whitespace text"
This reverts commit 4066dd6c1c.
Bug: 1376991
Change-Id: I9869417a9b9333fdf3a6b5796f94eabf9ac168e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3990067
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Owners-Override: Leo Zhang <googleo@google.com>
Reviewed-by: Colin Kincaid <ckincaid@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1064718}
This CL is a necessary precursor to CL:3964415, which moves
accessibility to post-lifecycle steps. It fixes a number of test
failures related to popups, e.g. in color and date popups.
When serializing, snapshotting or otherwise consuming the a11y
tree, ensure both layout and accessibility are clean and up-to-date
for both the main document and (if present), the popup document.
This avoids situations where layout or a11y are not clean and
up-to-date when crossing from one document to the other.
This is accomplished by introducing WebAXContext::UpdateAXForAllDocuments() which calls into
AXObjectCacheImpl, which now tracks both the main and the
popup document, when showing. The old static methods on
WebAXObject to update layout are now removed.
Test changes:
* Changes to date-picker-ax, week-picker-ax, and month-picker-ax were
necessary as the number of dirty objects generated has changed.
This CL now removes the TestExpectations and
FlagExpectations for these files as they should consistently pass now.
Follow-ups:
* Move a11y to post-lifecycle steps (CL:3964415)
* Get rid of raw pointer to AXContext in WebAXObjectProxyList (see TODO in header)
* Update lifecycle unconditionally in AXObjectCacheImpl::UpdateLifecycleIfNeeded(), letting the layout code handle the conditions for early return. CL:3968646.
* Do not throw away return value from lifecycle update function,
because it indicates there is a throttling scenario, and that
the caller should defer work until later.
Bug: None
Change-Id: Ie0f661aadc397b3d74a871b23e8b347ff1a30215
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3961549
Reviewed-by: Chris Harrelson <chrishtr@chromium.org>
Reviewed-by: Stefan Zager <szager@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1062326}
This is a precursor for work to move a11y to RunPostLifecycleSteps()
in CL:3861311.
There is no need to force a layout on every dirty node --
WebAXObject::MaybeUpdateLayoutAndCheckValidity() does not do this currently.
The only reason to ever do this might be if we wanted updated layout
information for every content-visibility: auto object, but this is
not necessary because the a11y code already special cases
content-visibility: auto objects with stale layout by not exposing
information that requires a layout object such as style, location and
perfect whitespace computation. If a user tries to navigate to one
of these objects (e.g. via a skip to next heading command), then it
will be scrolled into view and receive full layout at that time.
In addition, forcing a layout for every content-visibility: auto node
would cost performance, including for users of password managers, etc.
and would ruin a lot of the benefit of content-visibility.
Bug: None
Change-Id: Id5ea7939bc997d0f8b100cd02fd736f3f4f9c9ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3905906
Reviewed-by: David Tseng <dtseng@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1049902}
This inlines all remaining DISALLOW_* macros in content/. This is done
manually (vim regex + manually finding insertion position).
IWYU cleanup is left as a separate pass that is easier when these macros
go away.
Bug: 1010217
Change-Id: I8b5ea6dd9f8a3f584cf3eef82634017a38b15be8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3193883
Commit-Queue: Peter Boström <pbos@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#936160}
base::size() has been moved to base/cxx17_backports.h, so .cc files that
use base::size(), but no other function from base/stl_util.h, can
directly include base/cxx17_backports.h and not base/stl_util.h.
Bug: 1210983
Change-Id: I42a598a9c2b8fcbfd1e225329109ae3308bd9518
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2915348
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#886358}
The call to PermissionsHelper.setPermission was not always propagating
to AXObjectCacheImpl right away. Previously we had a setTimeout(0),
which was enough most of the time but not reliable, leaking to
flaky tests.
Fix by adding a new test API to determine whether the permission
change has propagated to AXObjectCacheImpl, and don't resolve
the promise to continue the test until it has propagated.
Fixes: 1134459
Change-Id: I30ecf2514908bf19b824adde3929020194bd57c2
AX-Relnotes: N/A
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2815654
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Adam Ettenberger <Adam.Ettenberger@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#871109}
Previously, the document lifecycle changed at least once per node
that is either dirty or an event source, during
SendPendingAccessibilityEvents().
This updates SendPendingAccessibilityEvents() to only update the
main document and popup document lifecycles only once.
In addition, detailed DCHECKs are performed to ensure that the layout
layout tree state is up to date for each node accessed during
this process.
AX-Relnotes: n/a
Bug: None
Change-Id: I45cdcb1c03e5284c43fd94a8c5ac4d58d837566f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2187136
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: vmpstr <vmpstr@chromium.org>
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809321}