The attribute cache is not enabled in traverseToOffsetInRange, causing more accessibilityIsIgnored calls than necessary.
<rdar://problem/116703599>
Created attachment 468137 [details] Patch
(In reply to Joshua Hoffman from comment #2) > Created attachment 468137 [details] > Patch diff --git a/Source/WebCore/accessibility/AXObjectCache.cpp b/Source/WebCore/accessibility/AXObjectCache.cpp index 05688086b278..bea7eaf1ef97 100644 --- a/Source/WebCore/accessibility/AXObjectCache.cpp +++ b/Source/WebCore/accessibility/AXObjectCache.cpp @@ -2679,6 +2679,9 @@ CharacterOffset AXObjectCache::traverseToOffsetInRange(const SimpleRange& range, behaviors.add(TextIteratorBehavior::EntersTextControls); TextIterator iterator(range, behaviors); + // Enable the cache here for accessibilityIsIgnored calls in replacedNodeNeedsCharacter + AXAttributeCacheEnabler enableCache(this); AG: if the problem is in replacedNodeNeedsCharacter, shouldn't we enable the caching there instead? + // When the range has zero length, there might be replaced node or brTag that we need to increment the characterOffset. if (iterator.atEnd()) { currentNode = range.start.container.ptr();
(In reply to Andres Gonzalez from comment #3) > (In reply to Joshua Hoffman from comment #2) > > Created attachment 468137 [details] > > Patch > + // Enable the cache here for accessibilityIsIgnored calls in > replacedNodeNeedsCharacter > + AXAttributeCacheEnabler enableCache(this); > > AG: if the problem is in replacedNodeNeedsCharacter, shouldn't we enable the > caching there instead? replacedNodeNeedsCharacter, is called in a loop inside traverseToOffsetInRange, so we want to make sure the cache stays enabled across all of those calls to prevent duplicate work.
Committed 269149@main (7d4e7afc92b3): <https://commits.webkit.org/269149@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 468137 [details].