Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2058823002: Implement callback reactions for Custom Elements V1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stack-ce
Patch Set: Minor cleanup Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698