[CTW] ApplyCrossDocOffset checks Parent before IsDoc
Categories
(Core :: Disability Access APIs, task)
Tracking
()
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.
Assignee | ||
Comment 1•2 years ago
|
||
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
Comment 3•2 years ago
|
||
bugherder |
Description
•