Bug 1385193 - Set owner rule of child sheet properly. r?emilio
MozReview-Commit-ID: GvQpA9wibIS
--- a/layout/style/ServoImportRule.cpp
+++ b/layout/style/ServoImportRule.cpp
@@ -16,16 +16,17 @@ namespace mozilla {
ServoImportRule::ServoImportRule(RefPtr<RawServoImportRule> aRawRule,
uint32_t aLine, uint32_t aColumn)
: CSSImportRule(aLine, aColumn)
, mRawRule(Move(aRawRule))
{
const auto* sheet = Servo_ImportRule_GetSheet(mRawRule.get());
MOZ_ASSERT(sheet);
mChildSheet = const_cast<ServoStyleSheet*>(sheet);
+ mChildSheet->SetOwnerRule(this);
}
ServoImportRule::~ServoImportRule()
{
if (mChildSheet) {
mChildSheet->SetOwnerRule(nullptr);
}
}