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

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

Issue 2279703002: Add a scoped context object for synchronous CE creation (Closed)
Patch Set: Clean up Created 4 years, 4 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/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 77e327f20115c9ae3ce0ec6993fa13938d6998ae..57ba51ac259f16fb215d0c4ddd3679915249c36f 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLElementCustom.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8HTMLElementCustom.cpp
@@ -59,9 +59,13 @@ void V8HTMLElement::constructorCustom(
// 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.
+ Document* context = window->customElementCreationContext();
+ if (!context)
+ context = window->document();
+
element = HTMLElement::create(
QualifiedName(nullAtom, definition->descriptor().localName(), HTMLNames::xhtmlNamespaceURI),
- *window->document());
+ *context);
// TODO(davaajav): write this as one call to setCustomElementState instead of two
element->setCustomElementState(CustomElementState::Undefined);
element->setCustomElementDefinition(definition);

Powered by Google App Engine
This is Rietveld 408576698