Bug 1544548 - Insert quirks.css later so that we hit the cascade data cache more often. r=heycam
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 15 Apr 2019 21:58:46 +0200
changeset 469678 a7b03452b97f
parent 469677 638822e29d0d
child 469679 724fc2049046
push id35879
push usernerli@mozilla.com
push dateTue, 16 Apr 2019 22:01:48 +0000
treeherdermozilla-central@12a60898fdc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1544548, 1535788
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1544548 - Insert quirks.css later so that we hit the cascade data cache more often. r=heycam Bug 1535788 moved the quirks.css insertion earlier, so the order will not match when the commonish case where the document gets a shell and then knows the compat mode, which means that we hit the cascade data cache a bit less often. I'll also fix the order of the preference sheet vs. the quirks sheet in a followup, right now whatever gets first ends ups earlier on the list. Differential Revision: https://phabricator.services.mozilla.com/D27578
dom/base/Document.cpp
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -2337,29 +2337,29 @@ void Document::FillStyleSetUserAndUAShee
   // that non-XUL (typically HTML) documents commonly use.
   mStyleSet->AppendStyleSheet(SheetType::Agent, cache->MinimalXULSheet());
 
   // Only load the full XUL sheet if we'll need it.
   if (LoadsFullXULStyleSheetUpFront()) {
     mStyleSet->AppendStyleSheet(SheetType::Agent, cache->XULSheet());
   }
 
-  MOZ_ASSERT(!mQuirkSheetAdded);
-  if (mCompatMode == eCompatibility_NavQuirks) {
-    mStyleSet->AppendStyleSheet(SheetType::Agent, cache->QuirkSheet());
-    mQuirkSheetAdded = true;
-  }
-
   mStyleSet->AppendStyleSheet(SheetType::Agent, cache->FormsSheet());
   mStyleSet->AppendStyleSheet(SheetType::Agent, cache->ScrollbarsSheet());
   mStyleSet->AppendStyleSheet(SheetType::Agent, cache->PluginProblemSheet());
 
   for (StyleSheet* sheet : *sheetService->AgentStyleSheets()) {
     mStyleSet->AppendStyleSheet(SheetType::Agent, sheet);
   }
+
+  MOZ_ASSERT(!mQuirkSheetAdded);
+  if (NeedsQuirksSheet()) {
+    mStyleSet->AppendStyleSheet(SheetType::Agent, cache->QuirkSheet());
+    mQuirkSheetAdded = true;
+  }
 }
 
 void Document::FillStyleSet() {
   MOZ_ASSERT(!mStyleSetFilled);
   FillStyleSetUserAndUASheets();
   FillStyleSetDocumentSheets();
   mStyleSetFilled = true;
 }