Bug 1359217 part 2 - Include the import rule of child sheet when notifying StyleRuleAdded. r?heycam
MozReview-Commit-ID: 1jDrwrUdyOa
--- 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()
{