Bug 1359217 part 2 - Include the import rule of child sheet when notifying StyleRuleAdded. r?heycam draft
authorXidorn Quan <me@upsuper.org>
Thu, 15 Jun 2017 13:36:45 +1000
changeset 596238 93641dbf74d05faf9043419aa9485bbd1c63b850
parent 596237 64481d27547196d9e3794eeea562492af67d900f
child 596239 38f2eb34293e7781f662b02efe1248816d9b7be0
push id64551
push userxquan@mozilla.com
push dateMon, 19 Jun 2017 02:08:42 +0000
reviewersheycam
bugs1359217
milestone56.0a1
Bug 1359217 part 2 - Include the import rule of child sheet when notifying StyleRuleAdded. r?heycam MozReview-Commit-ID: 1jDrwrUdyOa
layout/style/ServoStyleSheet.cpp
--- a/layout/style/ServoStyleSheet.cpp
+++ b/layout/style/ServoStyleSheet.cpp
@@ -4,16 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/ServoStyleSheet.h"
 
 #include "mozilla/css/Rule.h"
 #include "mozilla/StyleBackendType.h"
 #include "mozilla/ServoBindings.h"
+#include "mozilla/ServoImportRule.h"
 #include "mozilla/ServoMediaList.h"
 #include "mozilla/ServoCSSRuleList.h"
 #include "mozilla/css/GroupRule.h"
 #include "mozilla/dom/CSSRuleList.h"
 #include "mozilla/dom/MediaList.h"
 #include "nsIStyleSheetLinkingElement.h"
 #include "Loader.h"
 
@@ -253,18 +254,17 @@ ServoStyleSheet::StyleSheetLoaded(StyleS
   if (sheet->GetParentSheet() == nullptr) {
     return NS_OK; // ignore if sheet has been detached already
   }
   NS_ASSERTION(this == sheet->GetParentSheet(),
                "We are being notified of a sheet load for a sheet that is not our child!");
 
   if (mDocument && NS_SUCCEEDED(aStatus)) {
     mozAutoDocUpdate updateBatch(mDocument, UPDATE_STYLE, true);
-    NS_WARNING("stylo: Import rule object not implemented");
-    mDocument->StyleRuleAdded(this, nullptr);
+    mDocument->StyleRuleAdded(this, sheet->GetOwnerRule());
   }
 
   return NS_OK;
 }
 
 void
 ServoStyleSheet::DropRuleList()
 {