[wpt-sync] Sync PR 43431 - Reland: [a11y] Move some of serialization pipeline from RAI to cache.
Categories
(Testing :: web-platform-tests, task, P4)
Tracking
(Not tracked)
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 43431 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/43431
Details from upstream follow.
Ahmed Elwasefi <a.m.elwasefi@gmail.com> wrote:
Reland: [a11y] Move some of serialization pipeline from RAI to cache.
The previous CL at https://chromium-review.googlesource.com/c/chromium/src/+/4994320 was reverted due to an issue in clusterfuzz: crbug.com/1505157
It was fixed by making sure any pending tasks to serialize is cancelled on Dispose of AXObjectCacheImpl. The issue stemmed from the fact AXObjectCacheImpl is GCed and thus, any delayed events happening after disposal but not destroyed caused use-after-poison errors.------ ORIGINAL DESCRIPTION ------
This CL aims to start moving some of the code path starting from HandleAXEvent to ScheduleImmediateAXUpdate over to cache side. The old code is still left in RAI for legacy support.The aim is to eventually delete the code from RAI side, and then RAI would only be called from ProcessDeferredAccessibilityEvents to AXReadyCallback.
Details (only explaining post-lifecyle mode):
Before this CL, a11y events (kind of) go like this: AXObjectCacheImpl::PostPlatformNotification -> RenderAccessibilityImpl::HandleAXEvent which also calls AXObjectCacheImpl::AddPendingEvent --> RenderAccessibilityImpl::ScheduleImmediateAXUpdate -> AXObjectCacheImpl::ScheduleAXUpdate --> AXObjectCacheImpl::ProcessDeferredAccessibilityEvents -> RenderAccessibilityImpl::AXReadyCallbackNote that -> doesn't mean direct calls. Some calls in the middle may have been skipped. The CL prevents these excessively unnecessary calls in between RAI (RenderAccessibilityImpl) and AXObjectCacheImpl. The calls now go like this (again kinda): AXObjectCacheImpl::PostPlatformNotification -> AXObjectCacheImpl::AddEventToSerializationQueue -> AXObjectCacheImpl::ScheduleImmediateSerialization -> AXObjectCacheImpl::ScheduleAXUpdate -> AXObjectCacheImpl::ProcessDeferredAccessibilityEvents -> RenderAccessibilityImpl::AXReadyCallback
Notice how RAI is only called at the very end. Of course, to make this possible many of the side logic had to be moved too like the delaying code that used to be AXReadyCallback is now at AXObjectCacheImpl::ProcessDeferredAccessibilityEvents.
This image describes the above: https://i.imgur.com/U3tODTX.png
What the CL achieves is moving the code in the blue square over to the left-hand side, thus making the code stay in AXObjectCache longer and only move to RAI at RenderAccessibilityImpl::AXReadyCallback. The serialization delay is moved to ProcessDeferredAccessibilityEvents.
Legacy scheduling mode (as opposed to post-lifecycle serialization) still uses the old code which goes back and forth between RAI and AXObjectCache. The reason they were not moved as well is that legacy mode will get removed eventually anyway. When legacy mode is removed, we can safely remove the old code from RAI.
Also, with the cleaner code, it'll be feasible to change the scheduling logic further to limit some events like scrolling. Scrolling improvements discussed here https://docs.google.com/document/d/1fBK1BBrG8souqZpyv7q_3kxCYF1IYoXNPXmoVL7X8Gk/edit#heading=h.uo8ebdp7cxl
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4994320
Reviewed-by: Peter Beverloo \<peter@chromium.org>
Auto-Submit: Ahmed Elwasefi (Ahmad45123) \<a.m.elwasefi@gmail.com>
Reviewed-by: Aaron Leventhal \<aleventhal@chromium.org>
Reviewed-by: Jeremy Roman \<jbroman@chromium.org>
Commit-Queue: Ahmed Elwasefi (Ahmad45123) \<a.m.elwasefi@gmail.com>
Cr-Commit-Position: refs/heads/main@{#1227944}
Change-Id: Ia61a309dd11bee3e31408613cbc67751f9474f55
Reviewed-on: https://chromium-review.googlesource.com/5074053
WPT-Export-Revision: b49875e0d3f8970e2353b5d22fb80db9336e09c4
| Assignee | ||
Updated•2 years ago
|
Description
•