Bug 1111463 part 1 - Invalidate html.css when ruby pref changes. r=dbaron
authorXidorn Quan <quanxunzhen@gmail.com>
Mon, 12 Jan 2015 12:52:19 +1100
changeset 223235 70e558ca91634f889d6557960f6baad8c9607256
parent 223234 26f5729d5ccc245abe201fb339b6b16351c148b4
child 223236 82612d0c8c73cb1b0d3713ca4d18f0f793bddd99
push id10769
push usercbook@mozilla.com
push dateMon, 12 Jan 2015 14:15:52 +0000
treeherderfx-team@0e9765732906 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1111463
milestone37.0a1
Bug 1111463 part 1 - Invalidate html.css when ruby pref changes. r=dbaron
layout/style/nsLayoutStylesheetCache.cpp
--- a/layout/style/nsLayoutStylesheetCache.cpp
+++ b/layout/style/nsLayoutStylesheetCache.cpp
@@ -122,16 +122,22 @@ nsLayoutStylesheetCache::UASheet()
 
   return gStyleCache->mUASheet;
 }
 
 CSSStyleSheet*
 nsLayoutStylesheetCache::HTMLSheet()
 {
   EnsureGlobal();
+
+  if (!gStyleCache->mHTMLSheet) {
+    LoadSheetURL("resource://gre-resources/html.css",
+                 gStyleCache->mHTMLSheet, true);
+  }
+
   return gStyleCache->mHTMLSheet;
 }
 
 CSSStyleSheet*
 nsLayoutStylesheetCache::MinimalXULSheet()
 {
   EnsureGlobal();
   return gStyleCache->mMinimalXULSheet;
@@ -251,18 +257,16 @@ nsLayoutStylesheetCache::nsLayoutStylesh
   InitFromProfile();
 
   // And make sure that we load our UA sheets.  No need to do this
   // per-profile, since they're profile-invariant.
   LoadSheetURL("resource://gre-resources/counterstyles.css",
                mCounterStylesSheet, true);
   LoadSheetURL("resource://gre-resources/full-screen-override.css",
                mFullScreenOverrideSheet, true);
-  LoadSheetURL("resource://gre-resources/html.css",
-               mHTMLSheet, true);
   LoadSheetURL("chrome://global/content/minimal-xul.css",
                mMinimalXULSheet, true);
   LoadSheetURL("resource://gre-resources/quirk.css",
                mQuirkSheet, true);
   LoadSheetURL("resource://gre/res/svg.css",
                mSVGSheet, true);
   LoadSheetURL("chrome://global/content/xul.css",
                mXULSheet, true);
@@ -420,15 +424,16 @@ nsLayoutStylesheetCache::DependentPrefCh
 
   // Cause any UA style sheets whose parsing depends on the value of prefs
   // to be re-parsed by dropping the sheet from gCSSLoader's cache then
   // setting our cached sheet pointer to null.  This will only work for sheets
   // that are loaded lazily.
 
   // for layout.css.ruby.enabled
   InvalidateSheet(gStyleCache->mUASheet);
+  InvalidateSheet(gStyleCache->mHTMLSheet);
 }
 
 mozilla::StaticRefPtr<nsLayoutStylesheetCache>
 nsLayoutStylesheetCache::gStyleCache;
 
 mozilla::css::Loader*
 nsLayoutStylesheetCache::gCSSLoader = nullptr;