summaryrefslogtreecommitdiff
path: root/layout/style/StyleRule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layout/style/StyleRule.cpp')
-rw-r--r--layout/style/StyleRule.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/layout/style/StyleRule.cpp b/layout/style/StyleRule.cpp
index 598cb7c74e..aca97a505e 100644
--- a/layout/style/StyleRule.cpp
+++ b/layout/style/StyleRule.cpp
@@ -1078,6 +1078,16 @@ public:
return mRule ? mRule->GetDocument() : nullptr;
}
+ virtual DocGroup* GetDocGroup() const override
+ {
+ if (!mRule) {
+ return nullptr;
+ }
+
+ nsIDocument* document = mRule->GetDocument();
+ return document ? document->GetDocGroup() : nullptr;
+ }
+
friend class css::DOMCSSStyleRule;
protected:
@@ -1209,13 +1219,13 @@ DOMCSSDeclarationImpl::SetCSSDeclaration(DeclarationBlock* aDecl)
NS_PRECONDITION(mRule,
"can only be called when |GetCSSDeclaration| returned a declaration");
- nsCOMPtr<nsIDocument> owningDoc;
+ nsCOMPtr<nsIDocument> doc;
RefPtr<CSSStyleSheet> sheet = mRule->GetStyleSheet();
if (sheet) {
- owningDoc = sheet->GetOwningDocument();
+ doc = sheet->GetAssociatedDocument();
}
- mozAutoDocUpdate updateBatch(owningDoc, UPDATE_STYLE, true);
+ mozAutoDocUpdate updateBatch(doc, UPDATE_STYLE, true);
mRule->SetDeclaration(aDecl->AsGecko());
@@ -1223,8 +1233,8 @@ DOMCSSDeclarationImpl::SetCSSDeclaration(DeclarationBlock* aDecl)
sheet->DidDirty();
}
- if (owningDoc) {
- owningDoc->StyleRuleChanged(sheet, mRule);
+ if (doc) {
+ doc->StyleRuleChanged(sheet, mRule);
}
return NS_OK;
}