mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Bug 1334043 - Part 1: Replace attached callback (v0) with connected callback (v1).
Tag UXP Issue #1344
This commit is contained in:
parent
d1a1106760
commit
207d5a2e3e
4 changed files with 27 additions and 25 deletions
|
|
@ -1685,13 +1685,12 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
|||
}
|
||||
|
||||
nsIDocument* composedDoc = GetComposedDoc();
|
||||
if (composedDoc) {
|
||||
// Attached callback must be enqueued whenever custom element is inserted into a
|
||||
// document and this document has a browsing context.
|
||||
if (GetCustomElementData() && composedDoc->GetDocShell()) {
|
||||
// Enqueue an attached callback for the custom element.
|
||||
if (CustomElementRegistry::IsCustomElementEnabled() && composedDoc) {
|
||||
// Connected callback must be enqueued whenever a custom element becomes
|
||||
// connected.
|
||||
if (GetCustomElementData()) {
|
||||
nsContentUtils::EnqueueLifecycleCallback(
|
||||
composedDoc, nsIDocument::eAttached, this);
|
||||
composedDoc, nsIDocument::eConnected, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2586,7 +2585,7 @@ Element::SetAttrAndNotify(int32_t aNamespaceID,
|
|||
|
||||
UpdateState(aNotify);
|
||||
|
||||
if (nsContentUtils::IsWebComponentsEnabled()) {
|
||||
if (CustomElementRegistry::IsCustomElementEnabled()) {
|
||||
if (CustomElementData* data = GetCustomElementData()) {
|
||||
if (CustomElementDefinition* definition =
|
||||
nsContentUtils::GetElementDefinitionIfObservingAttr(this,
|
||||
|
|
@ -2853,7 +2852,7 @@ Element::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aName,
|
|||
|
||||
UpdateState(aNotify);
|
||||
|
||||
if (nsContentUtils::IsWebComponentsEnabled()) {
|
||||
if (CustomElementRegistry::IsCustomElementEnabled()) {
|
||||
if (CustomElementData* data = GetCustomElementData()) {
|
||||
if (CustomElementDefinition* definition =
|
||||
nsContentUtils::GetElementDefinitionIfObservingAttr(this,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue