Bug 1328652: Assume medium feature changes in nsPresContext::MediaFeatureValuesChanged. r=bz
This allows us to test our media query stuff at least, and works around the fact
that we don't set mUsesViewportUnits.
This will get us better test coverage, at the expense of more expensive window
resizes and similar, temporarily.
MozReview-Commit-ID: 7lgELz86lmW
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -2014,21 +2014,26 @@ nsPresContext::MediaFeatureValuesChanged
// changes yet.
if (mShell->StyleSet()->IsGecko()) {
if (mShell->StyleSet()->AsGecko()->MediumFeaturesChanged()) {
aRestyleHint |= eRestyle_Subtree;
}
} else {
NS_WARNING("stylo: ServoStyleSets don't support responding to medium "
"changes yet. See bug 1290228.");
+ aRestyleHint |= eRestyle_Subtree;
}
}
if (mUsesViewportUnits && mPendingViewportChange) {
// 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.
aRestyleHint |= eRestyle_ForceDescendants;
}
if (aRestyleHint || aChangeHint) {
RebuildAllStyleData(aChangeHint, aRestyleHint);
}
mPendingViewportChange = false;