Closed Bug 1300879 Opened 7 years ago Closed 2 years ago

Slow restyle on large page due to viewport being resized


(Core :: CSS Parsing and Computation, defect, P3)




Tracking Status
firefox51 --- affected


(Reporter: mstange, Unassigned)




 1. Go to and wait for it to load.
 2. Show / hide your bookmarks toolbar using View -> Toolbars -> Bookmarks Toolbar.
 3. Immediately after step 2, try to select text on the page.

The page hangs for about three seconds, doing restyling. The same happens when you open the findbar.

The restyle is triggered by nsPresContext::MediaFeatureValuesChanged.
Is it slower than just restyling everything?  Because depending on what media rules are present, that may in fact be happening....
And note that this particular page uses lots of viewport-relative units (vh and vw) last I looked, so changing the viewport height does in fact need to recalculate all sorts of stuff.  :(
(In reply to Boris Zbarsky [:bz] from comment #1)
> Is it slower than just restyling everything?

I haven't checked, because I thought restyling everything was unnecessary. But it sounds like it is necessary. Oh well.
Priority: -- → P3

The good news is that the style jank is gone, I did mozregression twice and am confident that bug 1718337 is what fixed the last of it. The bad news is that I'm getting 82s script jank, spun into bug 1771742

Closed: 2 years ago
Depends on: 1718337
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.