Closed Bug 1771736 Opened 1 year ago Closed 1 year ago

[CTW] Avoid redundant cache pushes for text


(Core :: Disability Access APIs, task)




103 Branch
Tracking Status
firefox103 --- fixed


(Reporter: Jamie, Assigned: Jamie)


(Blocks 1 open bug)


(Whiteboard: [ctw-m2])


(2 files)

When frames are reflowed, a11y gets text update notifications, even if the text hasn't changed. Currently, we push a cache update for such notifications without checking whether the text actually changed. We also implicitly push cache updates for line starts and text bounds whenever text cache pushes occur. This could mean many pointless, potentially expensive cache pushes if a large reflow occurs.

Whiteboard: [ctw-m2]

I originally thought we didn't need to be explicitly notified about removals because a correction always triggers a text change and we push a cache update for spelling errors whenever the text changes.
However, it seems that even when a correction is made and the text changes, the spell check ranges aren't yet up to date.
Previously, we were pushing a cache update whenever text was reflowed, which was taking care of this.
Soon, we don't want to push text cache updates if the text doesn't actually change.
We remove the reliance on these redundant text updates by having an explicit notification for spell check removals.

Layout sends a11y text update notifications during reflow even if the text hasn't changed.
TextUpdater already detects this case, so just move our cache update calls to TextUpdater.

Pushed by
part 1: Update cached spelling errors when a spelling error is removed. r=morgan,smaug
part 2: Only push a cache update for text if the text actually changes. r=morgan
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
You need to log in before you can comment on or make changes to this bug.