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 f1e231cb1aa15fc374b15bd984f335d3c4c34276..7f03f9417af00d6c2808ee473b05ba9d5f605dd0 100644 |
--- a/third_party/WebKit/Source/core/dom/custom/CustomElement.cpp |
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElement.cpp |
@@ -100,7 +100,16 @@ HTMLElement* CustomElement::createCustomElement(Document& document, const Qualif |
if (flags & AsynchronousCustomElements) |
return createCustomElementAsync(document, *definition, tagName); |
- // TODO(kojii): Synchronous mode implementation coming after async. |
+ // 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 (flags & CreatedByParser) |
+ return definition->createCustomElementIgnoringErrors(document, tagName); |
+ |
+ // 6.1. If the synchronous custom elements flag is set: |
+ return definition->createCustomElement(document, tagName); |
} |
} |