Try to avoid building hit test info items for positioned descendants

RESOLVED FIXED in Firefox 67

Status

()

enhancement
RESOLVED FIXED
5 months ago
Last month

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

Tracking

(Blocks 1 bug, Regressed 1 bug)

Trunk
mozilla67
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox67 fixed)

Details

Attachments

(1 attachment)

Currently we force a new HitTestInfo item each time we encountered a positioned frame [1].

This is because we sort the PositionedDescendants list, and even if the current frame's hit-test info matches the existing item, a future item might be different, and then be sorted into the middle.

For pages like maze solver [2], there are a massive number of positioned items, so we end up with a lot of hit-test items (even for otherwise hidden content, like the circle marker in each cell).

We shouldn't actually need these items in a lot of cases, since all hit-test items should be the same, and the sorting doesn't affect anything.

It seems like we should be able to check in advance to see if any descendants have styles that would make it possible for alternative hit-test flags to be created (cached as a frame state bit?), and we can skip this if we know all items will be identical.

We could also probably do culling of items during the Gecko->WR DL conversion pass, though we've already paid a large chunk of the cost, so I think that's a secondary priority.

[1] https://searchfox.org/mozilla-central/rev/4587d146681b16ff9878a6fdcba53b04f76abe1d/layout/generic/nsFrame.cpp#3772
[2] https://testdrive-archive.azurewebsites.net/Performance/MazeSolver/Default.html

Assignee: nobody → matt.woodrow
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f00a5d27f417
Only create new hit test info for positioned frame if they might be sorted into a different location. r=kats
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Regressions: 1559706
You need to log in before you can comment on or make changes to this bug.