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

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

Issue 2003033004: Split custom element script use and move it into bindings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback. 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/CustomElementDefinitionBuilder.h
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementDefinitionBuilder.h b/third_party/WebKit/Source/core/dom/custom/CustomElementDefinitionBuilder.h
new file mode 100644
index 0000000000000000000000000000000000000000..7c8dcd9cd0c57b7c5c568486968b4e56e6443333
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementDefinitionBuilder.h
@@ -0,0 +1,52 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CustomElementDefinitionBuilder_h
+#define CustomElementDefinitionBuilder_h
+
+#include "core/CoreExport.h"
+#include "wtf/Allocator.h"
+#include "wtf/Noncopyable.h"
+
+namespace blink {
+
+class CustomElementDefinition;
+class CustomElementDescriptor;
+class CustomElementsRegistry;
+class ExceptionState;
+class ScriptState;
+class ScriptValue;
+
+// Implement CustomElementDefinitionBuilder to provide
+// technology-specific steps for CustomElementsRegistry.define.
+// https://html.spec.whatwg.org/multipage/scripting.html#dom-customelementsregistry-define
+class CORE_EXPORT CustomElementDefinitionBuilder {
+ STACK_ALLOCATED();
+ WTF_MAKE_NONCOPYABLE(CustomElementDefinitionBuilder);
+public:
+ CustomElementDefinitionBuilder() { }
+
+ // This API necessarily sounds JavaScript specific; this implements
+ // some steps of the CustomElementsRegistry.define process, which
+ // are defined in terms of JavaScript.
+
+ // Check the constructor is valid. Return false if processing
+ // should not proceed.
+ virtual bool checkConstructorIntrinsics() = 0;
+
+ // Check the constructor is not already registered in the calling
+ // registry. Return false if processing should not proceed.
+ virtual bool checkConstructorNotRegistered() = 0;
+
+ // Checking the prototype may destroy the window. Return false if
+ // processing should not proceed.
+ virtual bool checkPrototype() = 0;
+
+ // Produce the definition. This must produce a definition.
+ virtual CustomElementDefinition* build(const CustomElementDescriptor&) = 0;
+};
+
+} // namespace blink
+
+#endif // CustomElementDefinitionBuilder_h

Powered by Google App Engine
This is Rietveld 408576698