Tab close button visibility code doesn't seem to deal with the case where "overflow" event is fired after resize, causing tab close buttons to be hidden when they shouldn't be
Categories
(Firefox :: Tabbed Browser, defect)
Tracking
()
People
(Reporter: saverio.morelli, Unassigned)
References
(Regression)
Details
(Keywords: regression)
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0
Steps to reproduce:
Version: 84.0b7 (64-bit), OS: Windows 10 Pro
When you have many tabs opened, the you resize the window (until all tabs aren't visible anymore), the re-maximise the window: now the "close" buttons are hidden (you need to open a new tab to fix it).
I've attached screenshots
Actual results:
The close buttons aren't visible
Expected results:
The close buttons should be visible again
| Reporter | ||
Comment 1•5 years ago
|
||
| Reporter | ||
Comment 2•5 years ago
|
||
Comment 3•5 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 4•5 years ago
•
|
||
I can reproduce the issue Firefox 75 as well as Nightly85.0a1 Windows10.
Reproducible : Almost 100% reproducible under the following STR
My test environment: Monitor 1920*1080, Windows10 1909
STR for bisect:
- Start with new profile
- Enable titlebar
- Open 8 tabs
- Reduce browser width so that tabbar will overflow(i.e <> buttons appear)
- Maximized
Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=e84157c7ee828bbca6c62ad836aaca28161dab95&tochange=95fe1470b3718d04e5c45605faedda62da140071
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 5•5 years ago
|
||
Nika, is this something we could fix for 93/94?
What should be the priority in this case?
Thank you!
Comment 6•4 years ago
|
||
I see that :dao moved this into the XPCOM component, but I don't see how the behaviour of the tab close icons is related to XPCOM specifically, given that it's controlled by the tabbed browser frontend. ni? :dao to potentially move back to Tabbed Browser.
Updated•4 years ago
|
Comment 7•4 years ago
|
||
I think Dao moved it to match where the regression is coming from - bug 1615607
Needinfo on smaug as he is the author of the regressor
Updated•4 years ago
|
Comment 8•4 years ago
|
||
Farre, can you have a look? Looks like the assumptions made in bug 1615607 weren't entirely correct?
Comment 9•4 years ago
|
||
This bug hints that some frontend code has wrong assumptions about scheduling.
(but this could be also something else having such assumptions)
Unfortunately I can't reproduce this, tested on linux and Windows.
Comment 10•4 years ago
|
||
FWIW,
When problem happens
Evaluating gBrowser.tabContainer._updateCloseButtons(); then the close buttons is displayed again.
Comment 11•4 years ago
•
|
||
Ok, so something is not calling that or something related when needed.
Or do we possibly have some issue with ResizeObserver
Comment 12•4 years ago
|
||
I think the frontend code looks reasonable.
I believe https://searchfox.org/mozilla-central/rev/2e3b0483e31abffe0b4374480a34c6d23f5186ea/browser/base/content/tabbrowser-tabs.js#88-89,92 should get called
dholbert, any ideas why ResizeObserver wouldn't be triggered
Comment 13•4 years ago
|
||
They're observing the documentElement size, does using window.addEventListener("resize") work out of curiosity? In this case it should be ~equivalent.
Comment 14•4 years ago
|
||
FWIW,
after evaluating the following code, it does not work.
window.addEventListener("resize",()=>{gBrowser.tabContainer._updateCloseButtons();})
after evaluating the following code, it works as expected.
window.addEventListener("resize",()=>{setTimeout(() => {gBrowser.tabContainer._updateCloseButtons();}, 0);})
Comment 15•4 years ago
|
||
Oh, I wonder if it's interacting badly with the overflow/underflow events.
Comment 16•4 years ago
|
||
Ah, yes, there is probably some race condition between https://searchfox.org/mozilla-central/rev/2e3b0483e31abffe0b4374480a34c6d23f5186ea/browser/base/content/tabbrowser-tabs.js#1176-1179 and resize notifications.
https://searchfox.org/mozilla-central/rev/2e3b0483e31abffe0b4374480a34c6d23f5186ea/layout/generic/nsGfxScrollFrame.cpp#5958 is triggered after https://searchfox.org/mozilla-central/rev/2e3b0483e31abffe0b4374480a34c6d23f5186ea/dom/base/ResizeObserverController.cpp#21,23
AddWillPaintObserver behaves in a bit odd way (see bug 1488953, which would remove it), but still, there might be ordering issue in resize vs. some other state.
Comment 17•4 years ago
|
||
Back to frontend. It doesn't seem to deal with the case where "overflow" event is fired after resize, yet that can happen, and that behavior has been there for ages.
Updated•2 years ago
|
Description
•