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 8a315ac28147b5eda6aa7dbba804fa25d43d6af4..d4b7049f5f97616aa08e615c2d5760ff12e0cad8 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLElementCustom.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLElementCustom.cpp |
@@ -55,12 +55,13 @@ void V8HTMLElement::constructorCustom( |
Element* element; |
if (definition->constructionStack().isEmpty()) { |
// This is an element being created with 'new' from script |
- element = window->document()->createElement( |
- definition->descriptor().localName(), |
- AtomicString(), |
- exceptionState); |
- if (exceptionState.throwIfNeeded()) |
- return; |
+ // TODO(kojii): When HTMLElementFactory has an option not to queue |
+ // upgrade, call that instead of HTMLElement. HTMLElement is enough |
+ // for now, but type extension will require HTMLElementFactory. |
+ element = HTMLElement::create( |
+ QualifiedName(nullAtom, definition->descriptor().localName(), HTMLNames::xhtmlNamespaceURI), |
+ *window->document()); |
+ element->setCustomElementState(CustomElementState::Undefined); |
} else { |
element = definition->constructionStack().last(); |
if (element) { |
@@ -91,11 +92,6 @@ void V8HTMLElement::constructorCustom( |
scriptState->context(), |
definition->prototype())); |
- // TODO(dominicc): These elements should be 'undefined', not |
- // 'uncustomized', on creation. Investigate why some elements are |
- // running around uncustomized. |
- if (element->getCustomElementState() == CustomElementState::Uncustomized) |
- element->setCustomElementState(CustomElementState::Undefined); |
// TODO(dominicc): Move this to the exactly correct place when |
// https://github.com/whatwg/html/issues/1297 is closed. |
element->setCustomElementState(CustomElementState::Custom); |