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

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

Issue 2443543002: createElement should not transmit exceptions but report them. (Closed)
Patch Set: Rebaseline tests. Created 4 years, 2 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/CustomElement.cpp
diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElement.cpp b/third_party/WebKit/Source/core/dom/custom/CustomElement.cpp
index 4e296c92c28d82bb1f82ba2e45f6ee17fba67426..2baf3bfefa30383be95843dfec0989c083083423 100644
--- a/third_party/WebKit/Source/core/dom/custom/CustomElement.cpp
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElement.cpp
@@ -78,45 +78,19 @@ static CustomElementDefinition* definitionForName(const Document& document,
HTMLElement* CustomElement::createCustomElementSync(
Document& document,
- const AtomicString& localName,
- ExceptionState& exceptionState) {
+ const AtomicString& localName) {
return createCustomElementSync(
document,
- QualifiedName(nullAtom, localName, HTMLNames::xhtmlNamespaceURI),
- exceptionState);
-}
-
-HTMLElement* CustomElement::createCustomElementSync(
- Document& document,
- const QualifiedName& tagName,
- ExceptionState& exceptionState) {
- DCHECK(shouldCreateCustomElement(tagName));
-
- // To create an element:
- // https://dom.spec.whatwg.org/#concept-create-element
- // 6. If definition is non-null, then:
- // 6.1. If the synchronous custom elements flag is set:
- if (CustomElementDefinition* definition =
- definitionForName(document, tagName))
- return definition->createElementSync(document, tagName, exceptionState);
-
- return createUndefinedElement(document, tagName);
+ QualifiedName(nullAtom, localName, HTMLNames::xhtmlNamespaceURI));
}
HTMLElement* CustomElement::createCustomElementSync(
Document& document,
const QualifiedName& tagName) {
DCHECK(shouldCreateCustomElement(tagName));
-
- // When invoked from "create an element for a token":
- // https://html.spec.whatwg.org/multipage/syntax.html#create-an-element-for-the-token
- // 7. If this step throws an exception, then report the exception,
- // and let element be instead a new element that implements
- // HTMLUnknownElement.
if (CustomElementDefinition* definition =
definitionForName(document, tagName))
return definition->createElementSync(document, tagName);
-
return createUndefinedElement(document, tagName);
}

Powered by Google App Engine
This is Rietveld 408576698