Closed Bug 1813980 Opened 1 year ago Closed 1 year ago

[CTW] ApplyCrossDocOffset checks Parent before IsDoc

Categories

(Core :: Disability Access APIs, task)

task

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

Details

Attachments

(1 file)

RemoteAccessibleBase::ApplyCrossDocOffset checks parent, returning early if it's null. It then checks IsDoc, returning early if that's false. We should flip that around, since IsDoc is cheaper given that Parent currently requires a hash lookup (bug 1798620).

This is a micro-optimisation, but I wonder whether it might matter, particularly for hit testing where we call Bounds a lot.

We call this function on every ancestor when calculating bounds.
RemoteParent() currently requires a hash lookup, so it's more efficient to early return for !IsDoc() first.
This is a micro-optimisation, but it might have some impact given that we call this on every ancestor, especially when hit testing, where we call Bounds() a lot.

As a bit of drive-by cleanup, use RemoteParent() rather than calling Parent() and IsRemote/AsRemote().

Pushed by jteh@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dd0fdd1daa69
Check IsDoc before Parent in RemoteAccessibleBase::ApplyCrossDocOffset. r=morgan
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: