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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLElementCustom.cpp

Issue 2033253003: (CANCELED) Fix V8HTMLElement::constructorCustom not to recurse to itself (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@d2
Patch Set: w/o new flag 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a7251482a4aae8584ef14e2f54ed45c409a0f41b..73b664806828e5432a80cf095c02631c7aa34195 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,14 @@ 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): We can't call HTMLElementFactory or
+ // Document::createElement because they will invoke custom element
+ // constructors. HTMLElement is enough for now, but type extesion
+ // will require to hook 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 +93,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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698