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

Unified Diff: Source/core/dom/Element.cpp

Issue 604773002: Custom Element should have a wrapper while frame navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Cleanup Layout Test Created 6 years, 3 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 | « LayoutTests/fast/dom/custom/resources/empty-custom-body.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 798a32658e8153e173740ecb7ec9469e3461a133..4a7693bd51319af8610565da5685f287c7b67b13 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -3237,16 +3237,17 @@ v8::Handle<v8::Object> Element::wrapCustomElement(v8::Handle<v8::Object> creatio
if (!isUpgradedCustomElement() || DOMWrapperWorld::world(context).isIsolatedWorld())
return ContainerNode::wrap(creationContext, isolate);
- V8PerContextData* perContextData = V8PerContextData::from(context);
- if (!perContextData)
- return v8::Handle<v8::Object>();
-
- CustomElementBinding* binding = perContextData->customElementBinding(customElementDefinition());
const WrapperTypeInfo* wrapperType = wrapperTypeInfo();
v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, wrapperType, toScriptWrappableBase(), isolate);
if (wrapper.IsEmpty())
return v8::Handle<v8::Object>();
+ V8PerContextData* perContextData = V8PerContextData::from(context);
+ if (!perContextData)
+ return wrapper;
+
+ CustomElementBinding* binding = perContextData->customElementBinding(customElementDefinition());
+
wrapper->SetPrototype(binding->prototype());
wrapperType->refObject(toScriptWrappableBase());
« no previous file with comments | « LayoutTests/fast/dom/custom/resources/empty-custom-body.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698