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

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

Issue 2023093003: Upgrade in-document custom elements when an element is defined. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ASAN failure in test helper. Created 4 years, 7 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 aca75ab78d0e92d763993d0224175795b5b30c6b..d922f14ab952b1e2e459d266063fa5011bb16776 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementDefinition.h
@@ -14,6 +14,7 @@
namespace blink {
class ScriptState;
+class Element;
class CORE_EXPORT CustomElementDefinition
: public GarbageCollectedFinalized<CustomElementDefinition> {
@@ -22,19 +23,34 @@ public:
CustomElementDefinition(const CustomElementDescriptor&);
virtual ~CustomElementDefinition();
+ DECLARE_VIRTUAL_TRACE();
+
const CustomElementDescriptor& descriptor() { return m_descriptor; }
- // TODO(yosin): To support Web Module, once we introduce abstract class
- // |CustomElementConstructor|, allows us to have JavaScript and C++
- // constructor, and ask binding layer to convert |CustomElementConstructor|
- // to |ScriptValue|, we should replace |getConstructorForScript()| by
- // |getConstructor() -> CustomElementConstructor|.
+ // TODO(yosin): To support Web Modules, introduce an abstract
+ // class |CustomElementConstructor| to allow us to have JavaScript
+ // and C++ constructors and ask the binding layer to convert
+ // |CustomElementConstructor| to |ScriptValue|. Replace
+ // |getConstructorForScript()| by |getConstructor() ->
+ // CustomElementConstructor|.
virtual ScriptValue getConstructorForScript() = 0;
- DEFINE_INLINE_VIRTUAL_TRACE() { }
+ using ConstructionStack = HeapVector<Member<Element>, 1>;
+ ConstructionStack& constructionStack()
+ {
+ return m_constructionStack;
+ }
+
+ void upgrade(Element*);
+
+protected:
+ // TODO(dominicc): Make this pure virtual when the script side is
+ // implemented.
+ virtual bool runConstructor(Element*);
private:
const CustomElementDescriptor m_descriptor;
+ ConstructionStack m_constructionStack;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698