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

Unified Diff: third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp

Issue 1994093002: Introduce CustomElementRegistry#get() method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-06-01T15:09:57 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/CustomElementsRegistry.cpp
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp
index 618fa6158733ce98c0e8a201fb189d03966b939a..e8fbde3d03ab1a71606c0bafeef9c9d952625c0f 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElementsRegistry.cpp
@@ -112,6 +112,18 @@ void CustomElementsRegistry::define(
// 20: when-defined promise processing
}
+// https://html.spec.whatwg.org/multipage/scripting.html#dom-customelementsregistry-get
+ScriptValue CustomElementsRegistry::get(const AtomicString& name)
+{
+ CustomElementDefinition* definition = definitionForName(name);
+ if (!definition) {
+ // Binding layer converts |ScriptValue()| to script specific value,
+ // e.g. |undefined| for v8.
+ return ScriptValue();
+ }
+ return definition->getConstructorForScript();
+}
+
bool CustomElementsRegistry::v0NameIsDefined(const AtomicString& name) const
{
if (!m_v0)

Powered by Google App Engine
This is Rietveld 408576698