Open Bug 1771429 Opened 2 years ago Updated 6 months ago

[CTW] Consider caching for RemoteAccessibleBase::EmbeddedChildAt

Categories

(Core :: Disability Access APIs, task)

task

Tracking

()

People

(Reporter: Jamie, Unassigned)

References

Details

For LocalAccessible, we have EmbeddedObjCollector which does caching for EmbeddedChildAt. RemoteAccessible doesn't have an equivalent cache.

Rendering an NVDA vbuf for this test case suggests we could benefit from caching this:
data:text/html,<div id="div"></div><script>let html = ""; for (let i = 0; i < 30000; ++i) { html += "<p>a</p>"; } div.innerHTML = html; </script>
Profile: https://share.firefox.dev/3GmvWsi

Similar to HyperText offset caching, I don't think we need something quite as smart as EmbeddedObjCollector. We can just lazily build an array for all children and clear it when there is a mutation.

IndexOfEmbeddedChild isn't used as much and I'm not yet convinced it needs to be optimised. That said, if the array contains child indices rather than Accessibles, we can use IndexInParent (as optimised in bug 1768396) and binary search the array.

This might help loading the WHATWG HTML spec, though it's unclear exactly how much.
Profile: https://share.firefox.dev/3TDcD4h

This might also help with bug 1770606 comment 26.

See Also: → 1770606
You need to log in before you can comment on or make changes to this bug.