From 43725c7264ca3f63de348d1d1596ce1fe9e64d2d Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sat, 13 Jun 2020 08:21:48 -0400 Subject: Bug 1426494 - Share more code between nsIDocument and ShadowRoot Tag #1375 --- dom/base/StyleSheetList.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dom/base/StyleSheetList.cpp') diff --git a/dom/base/StyleSheetList.cpp b/dom/base/StyleSheetList.cpp index 42db3179d..2b41473ff 100644 --- a/dom/base/StyleSheetList.cpp +++ b/dom/base/StyleSheetList.cpp @@ -48,19 +48,19 @@ StyleSheetList::SlowItem(uint32_t aIndex, nsIDOMStyleSheet** aItem) void StyleSheetList::NodeWillBeDestroyed(const nsINode* aNode) { - mStyleScope = nullptr; + mDocumentOrShadowRoot = nullptr; } -StyleSheetList::StyleSheetList(StyleScope& aScope) - : mStyleScope(&aScope) +StyleSheetList::StyleSheetList(DocumentOrShadowRoot& aScope) + : mDocumentOrShadowRoot(&aScope) { - mStyleScope->AsNode().AddMutationObserver(this); + mDocumentOrShadowRoot->AsNode().AddMutationObserver(this); } StyleSheetList::~StyleSheetList() { - if (mStyleScope) { - mStyleScope->AsNode().RemoveMutationObserver(this); + if (mDocumentOrShadowRoot) { + mDocumentOrShadowRoot->AsNode().RemoveMutationObserver(this); } } -- cgit v1.2.3