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)


(Firefox :: Theme, defect)

Firefox 108



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


(Reporter: ke5trel, Assigned: emilio)


(Blocks 1 open bug, Regression)


(Keywords: perf, regression)


(2 files)


  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:

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:

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

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

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
Blocks: 1797305
Flags: needinfo?(emilio)
Pushed by
Fix flex container dynamic overflow updates to avoid triggering extra reflows. r=TYLin
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 108 Branch
Regressions: 1797504
Duplicate of this bug: 1797344
See Also: → 1800719
You need to log in before you can comment on or make changes to this bug.