Bug 1441136: Add a fast way to enumerate ShadowRoots in a document. r=smaug
MozReview-Commit-ID: 7QffP56jsyk
This commit is contained in:
@@ -81,12 +81,35 @@ ShadowRoot::~ShadowRoot()
|
||||
host->RemoveMutationObserver(this);
|
||||
}
|
||||
|
||||
if (IsComposedDocParticipant()) {
|
||||
OwnerDoc()->RemoveComposedDocShadowRoot(*this);
|
||||
}
|
||||
|
||||
MOZ_DIAGNOSTIC_ASSERT(!OwnerDoc()->IsComposedDocShadowRoot(*this));
|
||||
|
||||
UnsetFlags(NODE_IS_IN_SHADOW_TREE);
|
||||
|
||||
// nsINode destructor expects mSubtreeRoot == this.
|
||||
SetSubtreeRootPointer(this);
|
||||
}
|
||||
|
||||
void
|
||||
ShadowRoot::SetIsComposedDocParticipant(bool aIsComposedDocParticipant)
|
||||
{
|
||||
bool changed = mIsComposedDocParticipant != aIsComposedDocParticipant;
|
||||
mIsComposedDocParticipant = aIsComposedDocParticipant;
|
||||
if (!changed) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
if (IsComposedDocParticipant()) {
|
||||
doc->AddComposedDocShadowRoot(*this);
|
||||
} else {
|
||||
doc->RemoveComposedDocShadowRoot(*this);
|
||||
}
|
||||
}
|
||||
|
||||
JSObject*
|
||||
ShadowRoot::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user