Index: third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLElementCustom.cpp |
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLElementCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLElementCustom.cpp |
index d4b7049f5f97616aa08e615c2d5760ff12e0cad8..5f34f6920d36000c8a164426c39f659a43fa491e 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLElementCustom.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLElementCustom.cpp |
@@ -12,6 +12,7 @@ |
#include "bindings/core/v8/V8DOMWrapper.h" |
#include "bindings/core/v8/V8ThrowException.h" |
#include "core/dom/Document.h" |
+#include "core/dom/Element.h" |
#include "core/dom/ExceptionCode.h" |
#include "core/dom/custom/CustomElementsRegistry.h" |
#include "core/frame/LocalDOMWindow.h" |
@@ -61,7 +62,10 @@ void V8HTMLElement::constructorCustom( |
element = HTMLElement::create( |
QualifiedName(nullAtom, definition->descriptor().localName(), HTMLNames::xhtmlNamespaceURI), |
*window->document()); |
+ // TODO(davaajav): write this as one call to setCustomElementState instead of two |
element->setCustomElementState(CustomElementState::Undefined); |
+ element->setCustomElementState(CustomElementState::Custom); |
+ element->setCustomElementDefinition(definition); |
} else { |
element = definition->constructionStack().last(); |
if (element) { |
@@ -91,10 +95,6 @@ void V8HTMLElement::constructorCustom( |
v8CallOrCrash(wrapper->SetPrototype( |
scriptState->context(), |
definition->prototype())); |
- |
- // TODO(dominicc): Move this to the exactly correct place when |
- // https://github.com/whatwg/html/issues/1297 is closed. |
- element->setCustomElementState(CustomElementState::Custom); |
} |
} // namespace blink |