Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f1bb6026e2728ef75990217f142d4fadb4c09eb6
https://github.com/WebKit/WebKit/commit/f1bb6026e2728ef75990217f142d4fadb4c09eb6
Author: Tyler Wilcock <[email protected]>
Date: 2026-10-01 (Thu, 01 Oct 2026)
Changed paths:
M Source/WebCore/accessibility/AXObjectCache.cpp
M Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Log Message:
-----------
AX: Hang in AccessibilityRenderObject::computeIsIgnored() when walking the
accessibility tree of pages with many list markers
https://bugs.webkit.org/show_bug.cgi?id=325882
rdar://186086198
Reviewed by Dominic Mazzoni.
The first deferred cache update for a document walks its entire accessibility
tree to register the live
regions that already exist (AXObjectCache::initializeLiveRegionManager()). On
some pages this hangs the
web process for seconds: in 17 spindumps of these hangs, 597 of 661 main-thread
samples are in one line of
AccessibilityRenderObject::parentObject(), called by the walk on a list marker.
To find a marker's parent, parentObject() tried every RenderListItem ancestor
of the marker and asked each
for its markerRenderer(). That checks whether the list item is ignored, which
outside of an attribute cache
scope means a fresh computeIsIgnored() that walks all of the list item's
ancestors more than once. So every
time the walk stepped out of a marker, it walked up the page several times for
each list item ancestor it
checked.
parentObject() now gets the list item directly from the marker with
RenderListOutsideMarker::listItem().
When the live region walk has to build the tree itself, it also asks whether
the same objects are ignored many times
over (23 times per object, on average, on a page of nested presentational
lists). So the walk now holds an
AXAttributeCacheScope, as AXIsolatedTree::generateSubtree() does.
Locally, walking an already-built tree of 20,476 list items nested 12 deep
inside 100 divs went from 102 ms
to 12 ms, with no is-ignored computations left (down from 28,654 and 20,476).
The attribute cache doesn't change those
numbers, but makes walks that build the tree a further 10-13% faster on the
same pages, and 80% faster
(69 ms to 14 ms) on the aforementioned presentational lists page.
* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::initializeLiveRegionManager):
* Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::parentObject const):
Canonical link: https://commits.webkit.org/322398@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications