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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2479243002: If 'is' is not null and custom element definition not found, NotFoundError should be thrown (Closed)
Patch Set: Created 4 years, 1 month 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/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index efdafbb7fdf63f77b1607c3fe6f9da43f9fb6e09..861f02fcd86f0f0c8ae52c27baf54386fc0ee341 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -699,8 +699,17 @@ String getTypeExtension(Document* document,
ElementCreationOptions impl;
V8ElementCreationOptions::toImpl(dict.isolate(), dict.v8Value(), impl,
exceptionState);
- if (impl.hasIs())
+ if (impl.hasIs()) {
+ AtomicString type(impl.is());
+ if (document->registrationContext() &&
dominicc (has gone to gerrit) 2016/11/16 02:46:41 I need to see this patch based on top of yurak's p
+ !document->registrationContext()->nameIsDefined(type) &&
+ !document->registrationContext()->v1NameIsDefined(type)) {
+ exceptionState.throwDOMException(NotFoundError,
+ "The type provided ('" + type + "') is not found.");
+ return emptyString();
+ }
return impl.is();
+ }
return toCoreString(dict.v8Value()->ToString());
}

Powered by Google App Engine
This is Rietveld 408576698