Closed Bug 1797272 Opened 1 year ago Closed 1 year ago

Dragging a tab through the toolbar has become janky when there are large numbers of tabs and at least one pinned tab (especially on Wayland)

Categories

(Firefox :: Theme, defect)

Firefox 108
defect

Tracking

()

RESOLVED FIXED
108 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox106 --- unaffected
firefox107 --- unaffected
firefox108 --- fixed

People

(Reporter: ke5trel, Assigned: emilio)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: perf, regression)

Attachments

(2 files)

STR:

  1. Start with MOZ_ENABLE_WAYLAND=1 on Ubuntu 22.04.
  2. Open a session with 2000 tabs.
  3. Pin at least one tab.
  4. Drag a tab to different positions in the toolbar at various speeds.

The previously smooth tab dragging has become janky and gets progressively worse with increasing number of tabs. It is much more severe on Linux Wayland than XWayland/X11 and can make the entire browser unresponsive for some time.

It does not happen when there are no pinned tabs, except for when the dragged tab hits the far right end of the strip.

Performance profile flame graph shows a lot of time spent in nsFlexContainerFrame layout reflow:
https://share.firefox.dev/3N1ApUk

Moving tabs with the keyboard shortcut (Ctrl+Shift+Page Up/Down) is unaffected.

Turning off tab animations with ui.prefersReducedMotion = 1 makes no difference.

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=4ff88d45f59c4357dcc71ddf4ad5344a38f9944d&tochange=aa325161aae5e555cab4d44b6662bbe029d26a5d

Regressed by Bug 1790616.

:emilio, since you are the author of the regressor, bug 1790616, could you take a look? Also, could you set the severity field?

For more information, please visit auto_nag documentation.

Flags: needinfo?(emilio)

Move the custom overflow code to UnionChildOverflow, so that it's
computed correctly from UpdateOverflow() when a transformed descendant
changes.

This can cause extra reflows in some cases. In the case of the tab bar
it was here:

https://searchfox.org/mozilla-central/rev/12a18f7e112a4dcf88d8441d439b84144bfbe9a3/layout/generic/nsGfxScrollFrame.cpp#6916

The subsequent reflow ended up fixing up the overflow areas, so I don't
think it's a correctness issue otherwise.

It seems grid has the same issue, but it seems a bit harder to fix
because of subgrid and masonry, so I'll file a follow-up bug for that.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Blocks: 1797305
Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d48aaf20cd4f
Fix flex container dynamic overflow updates to avoid triggering extra reflows. r=TYLin
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
Duplicate of this bug: 1797344
See Also: → 1800719
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: