| Summary: | AX: Attribute cache is not enabled in traverseToOffsetInRange | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Joshua Hoffman <jhoffman23> | ||||
| Component: | Accessibility | Assignee: | Joshua Hoffman <jhoffman23> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Attachments: |
|
||||||
|
Description
Joshua Hoffman
2023-10-09 15:40:00 PDT
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]. |