Wiki page flickers when the user switches between this and Customize Firefox page
Categories
(Core :: Layout: Images, Video, and HTML Frames, defect)
Tracking
()
People
(Reporter: csasca, Assigned: bgrins)
References
(Regression)
Details
(Keywords: regression)
Attachments
(3 files)
Affected versions
- Firefox 82.0
- Firefox 83.0a1
Affected platforms
- macOS 11
- Windows 10
- Ubuntu 20.04
Steps to reproduce
- Launch Firefox
- In one tab access for example this wiki page
- In another tab have Customize page opened
- Switch between the two tabs
Expected result
- The wiki page stays rendered
Actual result
- The page flickers twice
Regression range
- I will see for a regression
Additional notes
- The issue can be seen in the following attachment
Suggested severity
- S3
Reporter | ||
Updated•4 years ago
|
![]() |
||
Comment 1•4 years ago
|
||
Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=5cff72743ebc9266a78e4c6a41d17d68ac651326&tochange=5b1724bafc9387044cc794e9f69c31f151b26fd0
Regressed by Bug 1558995
Comment 2•4 years ago
|
||
Hi Brian, would you please take a look at this because this is regressed by Bug 1558995? Thanks.
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
This gif does show a bit of a flicker, but not as much as the video attached in Comment 0 which shows the web content immediately render and then flicker and then re-render.
I confirmed the attributes are being toggled in the frontend at the same time (collapsed for the #browser element and hidden for the #customization-container). This happens at https://searchfox.org/mozilla-central/rev/819be4899a92213abf121b449779ced662f2ce13/browser/components/customizableui/CustomizeMode.jsm#401-404 for entering Customize Mode and https://searchfox.org/mozilla-central/rev/819be4899a92213abf121b449779ced662f2ce13/browser/components/customizableui/CustomizeMode.jsm#530-533 for exiting.
:kats - I know there was some document splitting related changes for Customize Mode in Bug 1559389 as a result of Bug 1558995 (which caused this regression here). Do you think there's any relation here, or totally new problem?
Assignee | ||
Comment 4•4 years ago
|
||
Here's a profile for the same STR https://share.firefox.dev/34bT4YT
Assignee | ||
Comment 5•4 years ago
|
||
Here's a better gif of the problem showing the double render (I think it may have started happening once I made the window much larger than when I recorded the gif with the Browser Toolbox open)
Comment 6•4 years ago
|
||
The document splitting code has since been removed and all the functional changes should have been removed. I would be surprised if a change related to document splitting turned up here as being relevant, unless we missed something when deleting the code. So my guess here is that it's a totally new problem.
Assignee | ||
Comment 7•4 years ago
|
||
Here's a profile with the double render https://share.firefox.dev/3o0QnS1
Assignee | ||
Comment 8•4 years ago
|
||
Best guess based on a quick chat with :dholbert is that the style system is re-resolving styles when the tab goes from active to inactive, which ends up causing a repaint.
I'm at a bit of a loss about the blank paint in the middle though. Emilio - do you have any ideas? Comment 5 and Comment 7 are the most relevant bits here.
Assignee | ||
Comment 9•4 years ago
|
||
A couple more notes from our chat:
the page has a visibilitychanged listener on the root node (along with a bunch of others, but I think that's the only one that fires on tabswitch)
some fraction of the time, when I trigger the bug, I can also see the "Read|View Source|View History|" tabs "sliding in" from the right (edited)
and in devtools, it looks like that's happening via them dynamically setting the style attribute on those nodes (it's not like a pure-CSS-no-JS sort of thing)
it feels likely that this is related to the visibilitychange event and whatever JS they do as a result
Comment 10•4 years ago
|
||
So the issue is that bug 1558995 removed the <deck>
(which keeps the dimensions of the panel that's hidden) and changed it by .collapsed = true
, which resizes the <browser>
to be zero-size and thus has a bunch of side effects.
For example, if you put the devtools for the wikipedia tab in a separate window, then switch to the customizableui tab, you can see that window.innerHeight
and window.innerWidth
become 0
in the wikipedia tab. If I try the same with mozregression --launch 68
I see that innerWidth
etc do not change.
So I suspect the slide-in thing is not about visibilitychange (this happens regardless), it is about resize events. This probably also explains the blank paint and so on.
Does that help?
Assignee | ||
Comment 11•4 years ago
|
||
Yes - let me check if using .hidden
makes a difference. I believe the .collapsed
is carryover from the XBL days where hiding the element would destroy the binding and I can't think of a reason to prefer it here.
Comment 12•4 years ago
|
||
Quite likely .hidden
has the same issue.
Assignee | ||
Comment 13•4 years ago
|
||
FWIW switching to .hidden seems to fix the problem locally. I see an instant switch between Customize Mode and the wiki page with no repaint.
Assignee | ||
Comment 14•4 years ago
|
||
This is using collapsed as a carryover from XBL days, where setting the element to hidden would destroy bindings.
But it's causing a side effect of shrinking the browser element to 0x0 which causes the content to resize, leading to
some flickering and poor performance when switching back to content from a Customize Mode tab.
By setting hidden we instead are just toggling the display property.
Updated•4 years ago
|
Updated•4 years ago
|
Updated•4 years ago
|
Comment 15•4 years ago
|
||
Comment 16•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Comment 17•4 years ago
|
||
Backed out for causing bug 1672560
https://hg.mozilla.org/mozilla-central/rev/7e2acd77c07fc53754dbc685f3323e9055b82060
Assignee | ||
Comment 18•4 years ago
|
||
Emilio, should we focus on fixing the root cause of Bug 1672560 for L10nMutations and reland this or do you think it's just too risky to set the browser elements to hidden?
If the latter I guess we need to re-add a <deck> or some other parent that will allow the children to keep full height even when not visible. It'd be a good test for if Bug 1559192 will preserve that behavior if/when we migrate deck away from nsDeckFrame and to CSS grid (i.e. apply the patch over there on top of the deck addition and make sure we don't have any customize mode problems).
Comment 19•4 years ago
|
||
Honestly, I think the risk comes mostly for non-e10s tabs. Bug 1672560 probably just needs an extra check.
Is visibility: hidden
usable for this or such?
Updated•4 years ago
|
Comment 20•4 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:bgrins, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•4 years ago
|
Comment 21•3 years ago
|
||
I think this was filed under the wrong bug component. It should probably be under Firefox :: Toolbars and Customization.
Comment 22•2 years ago
|
||
Sorry for not searching before filing bug 1842809.
It looks like bug 1687592 will prevent bug 1672560-like crashes but if not, we might have to back out bug 1842809 :(
Description
•