Bug 101370

Summary: AX: Only walk up the parent tree one time in accessibilityIsIgnored
Product: WebKit Reporter: chris fleizach <cfleizach>
Component: AccessibilityAssignee: chris fleizach <cfleizach>
Status: NEW ---    
Severity: Normal CC: dmazzoni, jcraig, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description chris fleizach 2012-11-06 10:39:49 PST
We walk up the parent tree way too many times in accessibilityIsIgnored. we should figure out a way to consolidate
Comment 1 Dominic Mazzoni 2012-11-06 10:57:04 PST
A few ideas:

1. Walk up the parent chain once at the beginning of the function, store it in a list/vector. Then just access that list/vector every other time it's needed. This would probably only provide a modest speedup, though - at most a small constant factor.

2. Add a bitfield to every AccessibilityObject that's updated when it's first created / inserted in the tree, keeping track of things to look for in its parent chain, like if it's a descendant of a math block, or of a canvas, or of a table. I'm pretty sure those won't every change once an AccessibilityObject is created. This could provide  

3. I'm assuming that any properties that change in the parent change would trigger a layout. Perhaps we can compute a bunch of properties for each object and save the document's layout count, then recompute whenever the layout count has changed. The only thing that might not work for is ARIA-only changes, like if something in the parent chain changes aria-hidden - so maybe we'd have to explicitly mark all descendants as dirty in that case.

4. Chromium often walks the entire tree rooted at a single node. For that specific case it'd be possible to pass information about the parent chain along when exploring each child. Not sure if that'd help much with Mac.

Any thoughts?
Comment 2 Radar WebKit Bug Importer 2014-02-07 11:02:21 PST