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 469692 a7b03452b97fdcfb0d909ff22d42b5e65b06fb89
parent 469691 638822e29d0d29bccc4c40df41c8b5de5c58e131
child 469693 724fc2049046a87731d27183140132e5a2e7ff3c
push id112816
push usercbrindusan@mozilla.com
push dateWed, 17 Apr 2019 09:52:45 +0000
treeherdermozilla-inbound@bbca68b2af26 [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;
 }