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

Side by Side 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, 2 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 3219 matching lines...) Expand 10 before | Expand all | Expand 10 after
3230 v8::Handle<v8::Object> Element::wrapCustomElement(v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate) 3230 v8::Handle<v8::Object> Element::wrapCustomElement(v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate)
3231 { 3231 {
3232 ASSERT(!DOMDataStore::containsWrapperNonTemplate(this, isolate)); 3232 ASSERT(!DOMDataStore::containsWrapperNonTemplate(this, isolate));
3233 3233
3234 ASSERT(!creationContext.IsEmpty()); 3234 ASSERT(!creationContext.IsEmpty());
3235 v8::Handle<v8::Context> context = creationContext->CreationContext(); 3235 v8::Handle<v8::Context> context = creationContext->CreationContext();
3236 3236
3237 if (!isUpgradedCustomElement() || DOMWrapperWorld::world(context).isIsolated World()) 3237 if (!isUpgradedCustomElement() || DOMWrapperWorld::world(context).isIsolated World())
3238 return ContainerNode::wrap(creationContext, isolate); 3238 return ContainerNode::wrap(creationContext, isolate);
3239 3239
3240 V8PerContextData* perContextData = V8PerContextData::from(context);
3241 if (!perContextData)
3242 return v8::Handle<v8::Object>();
3243
3244 CustomElementBinding* binding = perContextData->customElementBinding(customE lementDefinition());
3245 const WrapperTypeInfo* wrapperType = wrapperTypeInfo(); 3240 const WrapperTypeInfo* wrapperType = wrapperTypeInfo();
3246 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , wrapperType, toScriptWrappableBase(), isolate); 3241 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext , wrapperType, toScriptWrappableBase(), isolate);
3247 if (wrapper.IsEmpty()) 3242 if (wrapper.IsEmpty())
3248 return v8::Handle<v8::Object>(); 3243 return v8::Handle<v8::Object>();
3249 3244
3245 V8PerContextData* perContextData = V8PerContextData::from(context);
3246 if (!perContextData)
3247 return wrapper;
3248
3249 CustomElementBinding* binding = perContextData->customElementBinding(customE lementDefinition());
3250
3250 wrapper->SetPrototype(binding->prototype()); 3251 wrapper->SetPrototype(binding->prototype());
3251 3252
3252 wrapperType->refObject(toScriptWrappableBase()); 3253 wrapperType->refObject(toScriptWrappableBase());
3253 V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType, wrapp er, isolate); 3254 V8DOMWrapper::associateObjectWithWrapperNonTemplate(this, wrapperType, wrapp er, isolate);
3254 return wrapper; 3255 return wrapper;
3255 } 3256 }
3256 3257
3257 } // namespace blink 3258 } // namespace blink
OLDNEW
« 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