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

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: dominicc review 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
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/dom/custom/CustomElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6da31da76d47fc37693792d15e6383f21ab1fba7 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1424,12 +1424,14 @@ Node::InsertionNotificationRequest Element::insertedInto(ContainerNode* insertio
}
if (inShadowIncludingDocument()) {
- if (getCustomElementState() != CustomElementState::Custom && CustomElement::descriptorMayMatch(*this)) {
+ if (getCustomElementState() == CustomElementState::Custom) {
+ CustomElement::enqueueConnectedCallback(this);
+ } else if (isUpgradedV0CustomElement()) {
+ V0CustomElement::didAttach(this, document());
+ } else if (getCustomElementState() == CustomElementState::Undefined) {
if (CustomElementsRegistry* registry = CustomElement::registry(*this))
registry->addCandidate(this);
}
- if (isUpgradedV0CustomElement())
- V0CustomElement::didAttach(this, document());
}
TreeScope& scope = insertionPoint->treeScope();
@@ -1490,7 +1492,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 +3193,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);
}
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/dom/custom/CustomElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698