Bug 1367568 part 3: For CSS "overflow" changes that don't require frame reconstruction, send same change hints as if CSS "height" and "width" changed. r?bz draft
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 25 May 2017 17:53:27 -0400
changeset 584693 0af22013e9ee79a8034b04b0f8564c3f00d5969b
parent 584692 9405fe40273f8d458e5cc4c359effbf7b2f3ccfd
child 584694 56939d4e6cd8ca018c3d0eec5b64776e136b4229
child 584703 475ca3ced4c8c1c4d2f862afbc5c4c882d84aa1d
child 584706 7eadf901018ace584225f4c8999e08cf823533ed
child 584707 83610333d47bca6b96f365039c63bca8c3c7a3d2
child 584723 d295710a73a0b88e933aa92efca92f275cf1e291
push id60842
push userdholbert@mozilla.com
push dateThu, 25 May 2017 21:53:59 +0000
reviewersbz
bugs1367568
milestone55.0a1
Bug 1367568 part 3: For CSS "overflow" changes that don't require frame reconstruction, send same change hints as if CSS "height" and "width" changed. r?bz This is less expensive than sending nsChangeHint_AllReflowHints, and it should be sufficient since hiding/showing scrollbars is basically just changing the available space. MozReview-Commit-ID: 4KyyLzvplAN
layout/base/RestyleManager.cpp
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1392,17 +1392,22 @@ RestyleManager::ProcessRestyledFrames(ns
             // replaced by) some other element as the viewport's
             // scrollbar-styles provider. (If it were, we'd potentially need to
             // reframe to create a dedicated scrollframe for whichever element
             // is being booted from providing viewport scrollbar styles.)
             //
             // Under these conditions, we're OK to assume that this "overflow"
             // change only impacts the root viewport's scrollframe, which
             // already exists, so we can simply reflow instead of reframing.
-            data.mHint |= nsChangeHint_AllReflowHints;
+            // When requesting this reflow, we send the exact same change hints
+            // that "width" and "height" would send (since conceptually,
+            // adding/removing scrollbars is like changing the available
+            // space).
+            data.mHint |= (nsChangeHint_ReflowHintsForISizeChange |
+                           nsChangeHint_ReflowHintsForBSizeChange);
             doReconstruct = false;
           }
         }
       }
       if (doReconstruct) {
         data.mHint |= nsChangeHint_ReconstructFrame;
       }
     }