Bug 1332353 - Make it clearer when a stylesheet is really owned by its mDocument

Tag #1375
This commit is contained in:
Matt A. Tobin 2020-04-17 05:46:23 -04:00 committed by Roy Tam
commit 5d444ef68a
13 changed files with 83 additions and 38 deletions

View file

@ -30,19 +30,23 @@ ServoStyleSheet::HasRules() const
}
void
ServoStyleSheet::SetOwningDocument(nsIDocument* aDocument)
ServoStyleSheet::SetAssociatedDocument(nsIDocument* aDocument,
DocumentAssociationMode aAssociationMode)
{
MOZ_ASSERT_IF(!aDocument, aAssociationMode == NotOwnedByDocument);
// XXXheycam: Traverse to child ServoStyleSheets to set this, like
// CSSStyleSheet::SetOwningDocument does.
// CSSStyleSheet::SetAssociatedDocument does.
mDocument = aDocument;
mDocumentAssociationMode = aAssociationMode;
}
ServoStyleSheet*
ServoStyleSheet::GetParentSheet() const
{
// XXXheycam: When we implement support for child sheets, we'll have
// to fix SetOwningDocument to propagate the owning document down
// to fix SetAssociatedDocument to propagate the associated document down
// to the children.
MOZ_CRASH("stylo: not implemented");
}