Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/Element.cpp |
| diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp |
| index ebaa903a39c876845428c9f71fc889bc35ced02e..2484cb8be37797032287da2896bc6f607fa74b14 100644 |
| --- a/third_party/WebKit/Source/core/dom/Element.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Element.cpp |
| @@ -1424,12 +1424,16 @@ Node::InsertionNotificationRequest Element::insertedInto(ContainerNode* insertio |
| } |
| if (inShadowIncludingDocument()) { |
| - if (getCustomElementState() != CustomElementState::Custom && CustomElement::descriptorMayMatch(*this)) { |
| - if (CustomElementsRegistry* registry = CustomElement::registry(*this)) |
| - registry->addCandidate(this); |
| + if (getCustomElementState() == CustomElementState::Custom) { |
| + CustomElement::enqueueConnectedCallback(this); |
| + } else { |
| + if (getCustomElementState() == CustomElementState::Undefined) { |
| + if (CustomElementsRegistry* registry = CustomElement::registry(*this)) |
| + registry->addCandidate(this); |
| + } |
| + if (isUpgradedV0CustomElement()) |
|
dominicc (has gone to gerrit)
2016/06/13 07:59:01
Maybe this case should come before if (getCustomEl
|
| + V0CustomElement::didAttach(this, document()); |
| } |
| - if (isUpgradedV0CustomElement()) |
| - V0CustomElement::didAttach(this, document()); |
| } |
| TreeScope& scope = insertionPoint->treeScope(); |
| @@ -1490,7 +1494,9 @@ void Element::removedFrom(ContainerNode* insertionPoint) |
| if (hasPendingResources()) |
| document().accessSVGExtensions().removeElementFromPendingResources(this); |
| - if (isUpgradedV0CustomElement()) |
| + if (getCustomElementState() == CustomElementState::Custom) |
| + CustomElement::enqueueDisconnectedCallback(this); |
| + else if (isUpgradedV0CustomElement()) |
| V0CustomElement::didDetach(this, insertionPoint->document()); |
| if (needsStyleInvalidation()) |
| @@ -3189,7 +3195,9 @@ void Element::willModifyAttribute(const QualifiedName& name, const AtomicString& |
| if (oldValue != newValue) { |
| document().styleEngine().attributeChangedForElement(name, *this); |
| - if (isUpgradedV0CustomElement()) |
| + if (getCustomElementState() == CustomElementState::Custom) |
| + CustomElement::enqueueAttributeChangedCallback(this, name, oldValue, newValue); |
| + else if (isUpgradedV0CustomElement()) |
| V0CustomElement::attributeDidChange(this, name.localName(), oldValue, newValue); |
| } |