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
--- 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;
}
}