mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 09:18:42 +09:00
Bug 1426494 - Share more code between nsIDocument and ShadowRoot
Tag #1375
This commit is contained in:
parent
15f6d2efda
commit
db72493615
23 changed files with 369 additions and 335 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue