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 1156806d5fd6dde1670b8356dbed13ad4effb619..6e2242b3a7aebbb1310e4bc0fc4185ce2e7bd8f1 100644 |
--- a/third_party/WebKit/Source/core/dom/custom/CustomElement.cpp |
+++ b/third_party/WebKit/Source/core/dom/custom/CustomElement.cpp |
@@ -15,6 +15,7 @@ |
#include "core/frame/FrameHost.h" |
#include "core/frame/LocalDOMWindow.h" |
#include "core/html/HTMLElement.h" |
+#include "core/html/HTMLUnknownElement.h" |
#include "platform/text/Character.h" |
#include "wtf/text/AtomicStringHash.h" |
@@ -168,6 +169,23 @@ HTMLElement* CustomElement::createUndefinedElement(Document& document, const Qua |
return element; |
} |
+HTMLElement* CustomElement::createFailedElement(Document& document, const QualifiedName& tagName) |
+{ |
+ DCHECK(shouldCreateCustomElement(document, tagName)); |
+ |
+ // "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, let element be instead a new element |
+ // that implements HTMLUnknownElement, with no attributes, namespace set to |
+ // given namespace, namespace prefix set to null, custom element state set |
+ // to "failed", and node document set to document. |
+ |
+ HTMLElement* element = HTMLUnknownElement::create(tagName, document); |
+ element->setCustomElementState(CustomElementState::Failed); |
+ return element; |
+} |
+ |
void CustomElement::enqueue(Element* element, CustomElementReaction* reaction) |
{ |
// To enqueue an element on the appropriate element queue |