mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 07:48:38 +09:00
Bug 1332353 - Make it clearer when a stylesheet is really owned by its mDocument
Tag #1375
This commit is contained in:
parent
db34da8e01
commit
5d444ef68a
13 changed files with 83 additions and 38 deletions
|
|
@ -1209,13 +1209,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 +1223,8 @@ DOMCSSDeclarationImpl::SetCSSDeclaration(DeclarationBlock* aDecl)
|
|||
sheet->DidDirty();
|
||||
}
|
||||
|
||||
if (owningDoc) {
|
||||
owningDoc->StyleRuleChanged(sheet, mRule);
|
||||
if (doc) {
|
||||
doc->StyleRuleChanged(sheet, mRule);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue