mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-05 23:07:31 +09:00
parent
db3b6b5884
commit
dba59f0317
5 changed files with 121 additions and 14 deletions
|
|
@ -1688,8 +1688,13 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|||
// Connected callback must be enqueued whenever a custom element becomes
|
||||
// connected.
|
||||
CustomElementData* data = GetCustomElementData();
|
||||
if (data && data->mState == CustomElementData::State::eCustom) {
|
||||
nsContentUtils::EnqueueLifecycleCallback(nsIDocument::eConnected, this);
|
||||
if (data) {
|
||||
if (data->mState == CustomElementData::State::eCustom) {
|
||||
nsContentUtils::EnqueueLifecycleCallback(nsIDocument::eConnected, this);
|
||||
} else {
|
||||
// Step 7.7.2.2 https://dom.spec.whatwg.org/#concept-node-insert
|
||||
nsContentUtils::TryToUpgradeElement(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1988,9 +1993,16 @@ Element::UnbindFromTree(bool aDeep, bool aNullParent)
|
|||
// disconnected.
|
||||
if (CustomElementRegistry::IsCustomElementEnabled()) {
|
||||
CustomElementData* data = GetCustomElementData();
|
||||
if (data && data->mState == CustomElementData::State::eCustom) {
|
||||
nsContentUtils::EnqueueLifecycleCallback(nsIDocument::eDisconnected,
|
||||
this);
|
||||
if (data) {
|
||||
if (data->mState == CustomElementData::State::eCustom) {
|
||||
nsContentUtils::EnqueueLifecycleCallback(nsIDocument::eDisconnected,
|
||||
this);
|
||||
} else {
|
||||
// Remove an unresolved custom element that is a candidate for
|
||||
// upgrade when a custom element is disconnected.
|
||||
// We will make sure it's shadow-including tree order in bug 1326028.
|
||||
nsContentUtils::UnregisterUnresolvedElement(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue