Closed Bug 1771736 Opened 2 years ago Closed 2 years ago

[CTW] Avoid redundant cache pushes for text

Categories

(Core :: Disability Access APIs, task)

task

Tracking

()

RESOLVED FIXED
103 Branch
Tracking Status
firefox103 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

Details

(Whiteboard: [ctw-m2])

Attachments

(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 jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d45e8d496c43
part 1: Update cached spelling errors when a spelling error is removed. r=morgan,smaug
https://hg.mozilla.org/integration/autoland/rev/6619f3ef5bcb
part 2: Only push a cache update for text if the text actually changes. r=morgan
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: