Revisit the chrome tab bar displayport bail-out now that the tab strip is user-scrollable
Categories
(Core :: Panning and Zooming, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox155 | --- | fixed |
People
(Reporter: dao, Assigned: tnikkel)
References
(Blocks 1 open bug)
Details
Attachments
(1 external file)
DisplayPortUtils::MaybeCreateDisplayPortInFirstScrollFrameEncountered() bails out on nsGkAtoms::tabbrowser_arrowscrollbox, with the comment "Don`t descend into the tab bar in chrome, it can be very large and does not contain any async scrollable elements".
That premise held when bug 1755290 added it: <scrollbox> was overflow: hidden and therefore never WantAsyncScroll(). Bug 1755290 comment 1 spells it out, including "they have been that way since the early 2000s, so doesn`t seem likely to change".
It has changed. The vertical tab strip's scrollbox is a real scroll container as of bug 2059794, so the tab bar does now contain an async scrollable element, and bug 1970536 will do the same for the horizontal strip. Today the strip only picks up a minimal displayport via ScrollContainerFrame::ShouldActivateAllScrollFrames(), which with apz.prefer_jank_minimal_displayports means the async scroll offset is suppressed until APZ requests a content repaint.
The original motivation still stands and should not be regressed: bug 1755290 measured this code at roughly 15% of the parent-process time to open a new tab in a session with many tabs. So the fix is presumably to let the tab bar`s own scroll frame be found without walking everything inside it, rather than to simply drop the bail-out.
| Assignee | ||
Comment 1•3 months ago
|
||
We should be able to consider the tab bar scrollable but not descend any further and preserve the optimization.
| Assignee | ||
Comment 2•3 months ago
|
||
MaybeCreateDisplayPortInFirstScrollFrameEncountered gives a displayport to the
first async scrollable frame it finds, so that frame is ready for APZ before
anything scrolls it. It skips tabbrowser-arrowscrollbox entirely. That was
correct when bug 1755290 added the bail out, because <scrollbox> was
overflow: hidden and so never WantAsyncScroll(). Bug 1899582 gave the vertical
tab strip's scrollbox overflow-y: auto, and bug 2059794 moves that into
arrowscrollbox.css gated on [overflowing], so the tab bar does contain an async
scrollable element now.
The strip therefore has only the minimal displayport from
ShouldActivateAllScrollFrames(), which with apz.prefer_jank_minimal_displayports
suppresses the async scroll offset until APZ requests a content repaint. It gets
a non-minimal one the first time it is scrolled. The bail out does not prevent
the strip from getting a displayport, only from having one before that first
scroll.
The arrowscrollbox's scroll container is a direct child frame and every tab
lives inside it, so scanning only the direct children finds it without walking
the tabs. That preserves the optimization bug 1755290 added, which was measured
at roughly 15% of the parent-process time to open a new tab in a session with
many tabs.
Updated•3 months ago
|
Updated•3 months ago
|
Description
•