Bug 1369903 Part 3: Ensure that Loader enables all cloned stylesheets, and checks modified state of all stylesheets, regardless of backend. r=emilio
authorBrad Werth <bwerth@mozilla.com>
Mon, 05 Jun 2017 09:24:25 -0700
changeset 362525 42669f4e317b9d18024c431a00f06d2701e72fde
parent 362524 66a0bce9a2997f5d7bd8bdbc67dd432bdd2c1f61
child 362526 f94e7abdc7d58a867a449b06ed59ba33d484da7d
push id44187
push userbwerth@mozilla.com
push dateTue, 06 Jun 2017 15:38:02 +0000
treeherderautoland@42669f4e317b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1369903
milestone55.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 1369903 Part 3: Ensure that Loader enables all cloned stylesheets, and checks modified state of all stylesheets, regardless of backend. r=emilio MozReview-Commit-ID: EEnFeaw2r0u
layout/style/Loader.cpp
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -1407,20 +1407,20 @@ Loader::InsertChildSheet(StyleSheet* aSh
                          ImportRule* aGeckoParentRule,
                          const RawServoStyleSheet* aServoChildSheet)
 {
   LOG(("css::Loader::InsertChildSheet"));
   MOZ_ASSERT(aSheet, "Nothing to insert");
   MOZ_ASSERT(aParentSheet, "Need a parent to insert into");
   MOZ_ASSERT_IF(aSheet->IsGecko(), aGeckoParentRule && !aServoChildSheet);
   MOZ_ASSERT_IF(aSheet->IsServo(), aServoChildSheet && !aGeckoParentRule);
+  // child sheets should always start out enabled, even if they got
+  // cloned off of top-level sheets which were disabled
+  aSheet->SetEnabled(true);
   if (aSheet->IsGecko()) {
-    // child sheets should always start out enabled, even if they got
-    // cloned off of top-level sheets which were disabled
-    aSheet->AsGecko()->SetEnabled(true);
     aGeckoParentRule->SetSheet(aSheet->AsGecko()); // This sets the ownerRule on the sheet
   } else {
     if (!aSheet->AsServo()->RawSheet()) {
       aSheet->AsServo()->SetSheetForImport(aServoChildSheet);
     }
   }
   aParentSheet->PrependStyleSheet(aSheet);
 
@@ -1895,18 +1895,17 @@ Loader::DoSheetComplete(SheetLoadData* a
 
   // Go through and deal with the whole linked list.
   SheetLoadData* data = aLoadData;
   while (data) {
     if (!data->mSheetAlreadyComplete) {
       // If mSheetAlreadyComplete, then the sheet could well be modified between
       // when we posted the async call to SheetComplete and now, since the sheet
       // was page-accessible during that whole time.
-      MOZ_ASSERT(!(data->mSheet->IsGecko() &&
-                   data->mSheet->AsGecko()->IsModified()),
+      MOZ_ASSERT(!data->mSheet->IsModified(),
                  "should not get marked modified during parsing");
       data->mSheet->SetComplete();
       data->ScheduleLoadEventIfNeeded(aStatus);
     }
     if (data->mMustNotify && (data->mObserver || !mObservers.IsEmpty())) {
       // Don't notify here so we don't trigger script.  Remember the
       // info we need to notify, then do it later when it's safe.
       aDatasToNotify.AppendElement(data);