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

Unified Diff: third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h

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
Index: third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h b/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h
index fb46146a12422198b4964149c9e4ca49ee22a1ac..c6fd2b0ff9112b613ce3185d5dae975af7b97647 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h
@@ -43,6 +43,22 @@ public:
void upgrade(Element*);
+ // TODO(kojii): Change these methods to pure when script-side is implemented.
+ virtual bool hasConnectedCallback() const { return true; }
+ virtual bool hasDisconnectedCallback() const { return true; }
+ virtual bool hasAttributeChangedCallback(const QualifiedName&) const { return true; }
+
+ virtual void runConnectedCallback(Element*) {}
+ virtual void runDisconnectedCallback(Element*) {}
+ virtual void runAttributeChangedCallback(Element*, const QualifiedName&,
+ const AtomicString& oldValue, const AtomicString& newValue) {}
+
+ void enqueueUpgradeReaction(Element*);
+ void enqueueConnectedCallback(Element*);
+ void enqueueDisconnectedCallback(Element*);
+ void enqueueAttributeChangedCallback(Element*, const QualifiedName&,
+ const AtomicString& oldValue, const AtomicString& newValue);
+
protected:
virtual bool runConstructor(Element*) = 0;

Powered by Google App Engine
This is Rietveld 408576698