Bug 1047928 patch 13 - Don't rerun selector matching for changes to zoom, min font size, or app units per dev pixel. r=bzbarsky
authorL. David Baron <dbaron@dbaron.org>
Wed, 08 Oct 2014 14:27:04 -0700
changeset 209480 fd52f15d25d343cad18c17177b80c7f1b82ebd08
parent 209479 096b2b23db0d60368d0db5ee2aaa33696c8e64c1
child 209481 5839fbd7b8c6e190d48ae4f9293f5e9edbcd84b5
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersbzbarsky
bugs1047928
milestone35.0a1
Bug 1047928 patch 13 - Don't rerun selector matching for changes to zoom, min font size, or app units per dev pixel. r=bzbarsky
layout/base/nsPresContext.cpp
layout/base/nsPresContext.h
--- 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);