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

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

Issue 2054433002: Implement "create an element" when sync for Custom Element V1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async-ce
Patch Set: Fix building tests Created 4 years, 6 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 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);
}
}

Powered by Google App Engine
This is Rietveld 408576698