| Index: Source/core/dom/Element.cpp
|
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
|
| index 2d21a43b0d8f3cea956828f9ca8b3e6aac3ebc79..5007525401807cff52d79cd8a586c98c911a2b53 100644
|
| --- a/Source/core/dom/Element.cpp
|
| +++ b/Source/core/dom/Element.cpp
|
| @@ -1268,6 +1268,11 @@ Node::InsertionNotificationRequest Element::insertedInto(ContainerNode* insertio
|
| if (scope != treeScope())
|
| return InsertionDone;
|
|
|
| + if (isUpgradedCustomElement()) {
|
| + RefPtr<CustomElementDefinition> definition = document()->registry()->findFor(this);
|
| + CustomElementCallbackDispatcher::instance().enqueueEnteredDocumentCallback(definition->callbacks(), this);
|
| + }
|
| +
|
| const AtomicString& idValue = getIdAttribute();
|
| if (!idValue.isNull())
|
| updateId(scope, nullAtom, idValue);
|
| @@ -1323,8 +1328,17 @@ void Element::removedFrom(ContainerNode* insertionPoint)
|
| }
|
|
|
| ContainerNode::removedFrom(insertionPoint);
|
| - if (wasInDocument && hasPendingResources())
|
| - document()->accessSVGExtensions()->removeElementFromPendingResources(this);
|
| + if (wasInDocument) {
|
| + if (hasPendingResources())
|
| + document()->accessSVGExtensions()->removeElementFromPendingResources(this);
|
| +
|
| + if (isUpgradedCustomElement()) {
|
| + if (CustomElementRegistry* registry = document()->registry()) {
|
| + RefPtr<CustomElementDefinition> definition = registry->findFor(this);
|
| + CustomElementCallbackDispatcher::instance().enqueueLeftDocumentCallback(definition->callbacks(), this);
|
| + }
|
| + }
|
| + }
|
| }
|
|
|
| void Element::createRendererIfNeeded(const AttachContext& context)
|
|
|