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

Unified Diff: third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl

Issue 2288653002: Make custom element name checks faster and fewer (Closed)
Patch Set: More feedback Created 4 years, 3 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/build/scripts/templates/ElementFactory.cpp.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl
index 385c01603ba81bcf9de31ccb7fb1019b711956b2..8125b5d559dab4318ec5005fc67c0473167efa72 100644
--- a/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/ElementFactory.cpp.tmpl
@@ -90,7 +90,12 @@ static void create{{namespace}}FunctionMap()
return function(document, {% if namespace == 'HTML' %}formElement, {% endif %}flags);
{% if namespace == 'HTML' %}
- if (CustomElement::shouldCreateCustomElement(localName)) {
+ // createElement handles custom element creation itself in order to
+ // transmit exceptions.
+ // TODO(dominicc): When the HTML parser can pass an error
+ // reporting ExceptionState, and "v0" custom elements have been
+ // removed, consolidate custom element creation into one place.
+ if (flags != CreatedByCreateElement && CustomElement::shouldCreateCustomElement(localName)) {
QualifiedName tagName(nullAtom, localName, HTMLNames::xhtmlNamespaceURI);
if (flags & AsynchronousCustomElements)
return CustomElement::createCustomElementAsync(document, tagName);

Powered by Google App Engine
This is Rietveld 408576698