Bug 1357461: Assume viewport units are used on resize. r?heycam
MozReview-Commit-ID: Eu2QxaGFChX
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -2069,22 +2069,25 @@ nsPresContext::MediaFeatureValuesChanged
{
mPendingMediaFeatureValuesChanged = false;
// MediumFeaturesChanged updates the applied rules, so it always gets called.
if (mShell && mShell->StyleSet()->MediumFeaturesChanged()) {
aRestyleHint |= eRestyle_Subtree;
}
- if (mUsesViewportUnits && mPendingViewportChange) {
+ if (mPendingViewportChange &&
+ (mUsesViewportUnits || mDocument->IsStyledByServo())) {
// Rebuild all style data without rerunning selector matching.
//
- // TODO(emilio, bug 1328652): We don't set mUsesViewportUnits in stylo yet.
- // This is wallpapered given we assume medium feature changes
- // unconditionally, but we need to fix this.
+ // FIXME(emilio, bug 1328652): We don't set mUsesViewportUnits in stylo yet,
+ // so assume the worst.
+ //
+ // Also, in this case we don't need to do a rebuild of the style data, only
+ // post a restyle.
aRestyleHint |= eRestyle_ForceDescendants;
}
if (aRestyleHint || aChangeHint) {
RebuildAllStyleData(aChangeHint, aRestyleHint);
}
mPendingViewportChange = false;