Bug 1047928 patch 13 - Don't rerun selector matching for changes to zoom, min font size, or app units per dev pixel. r=bzbarsky
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -842,17 +842,17 @@ nsPresContext::AppUnitsPerDevPixelChange
InvalidatePaintedLayers();
if (mDeviceContext) {
mDeviceContext->FlushFontCache();
}
if (HasCachedStyleData()) {
// All cached style data must be recomputed.
- MediaFeatureValuesChanged(eRestyle_Subtree, NS_STYLE_HINT_REFLOW);
+ MediaFeatureValuesChanged(eRestyle_ForceDescendants, NS_STYLE_HINT_REFLOW);
}
mCurAppUnitsPerDevPixel = AppUnitsPerDevPixel();
}
void
nsPresContext::PreferenceChanged(const char* aPrefName)
{
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -544,17 +544,18 @@ public:
void SetTextZoom(float aZoom) {
if (aZoom == mTextZoom)
return;
mTextZoom = aZoom;
if (HasCachedStyleData()) {
// Media queries could have changed, since we changed the meaning
// of 'em' units in them.
- MediaFeatureValuesChanged(eRestyle_Subtree, NS_STYLE_HINT_REFLOW);
+ MediaFeatureValuesChanged(eRestyle_ForceDescendants,
+ NS_STYLE_HINT_REFLOW);
}
}
/**
* Get the minimum font size for the specified language. If aLanguage
* is nullptr, then the document's language is used. This combines
* the language-specific global preference with the per-presentation
* base minimum font size.
@@ -579,17 +580,18 @@ public:
void SetBaseMinFontSize(int32_t aMinFontSize) {
if (aMinFontSize == mBaseMinFontSize)
return;
mBaseMinFontSize = aMinFontSize;
if (HasCachedStyleData()) {
// Media queries could have changed, since we changed the meaning
// of 'em' units in them.
- MediaFeatureValuesChanged(eRestyle_Subtree, NS_STYLE_HINT_REFLOW);
+ MediaFeatureValuesChanged(eRestyle_ForceDescendants,
+ NS_STYLE_HINT_REFLOW);
}
}
float GetFullZoom() { return mFullZoom; }
void SetFullZoom(float aZoom);
nscoord GetAutoQualityMinFontSize() {
return DevPixelsToAppUnits(mAutoQualityMinFontSizePixelsPref);