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

Unified Diff: Source/bindings/core/v8/CustomElementConstructorBuilder.cpp

Issue 1069953002: Implement Custom Element's class side inheritance (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed context delete test case Created 5 years, 8 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/registration-context-delete-during-register-base-constructor-retrieval-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/CustomElementConstructorBuilder.cpp
diff --git a/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp b/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp
index 5c57589d4347430d49734e7ef2356cb345bae8ad..6318130564e94d85736352e0e812eeb4977fb81b 100644
--- a/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp
+++ b/Source/bindings/core/v8/CustomElementConstructorBuilder.cpp
@@ -199,8 +199,13 @@ bool CustomElementConstructorBuilder::createConstructor(Document* document, Cust
if (!v8CallBoolean(m_constructor->ForceSet(context, prototypeKey, m_prototype, v8::PropertyAttribute(v8::ReadOnly | v8::DontEnum | v8::DontDelete))))
return false;
+ v8::Local<v8::String> constructorKey = v8String(isolate, "constructor");
+ // The generated constructor should inherit from constructor.
+ if (!v8CallBoolean(m_constructor->SetPrototype(context, m_prototype->Get(constructorKey))))
+ return false;
+
V8HiddenValue::setHiddenValue(isolate, m_prototype, V8HiddenValue::customElementIsInterfacePrototypeObject(isolate), v8::True(isolate));
- if (!v8CallBoolean(m_prototype->ForceSet(context, v8String(isolate, "constructor"), m_constructor, v8::DontEnum)))
+ if (!v8CallBoolean(m_prototype->ForceSet(context, constructorKey, m_constructor, v8::DontEnum)))
return false;
return true;
« no previous file with comments | « LayoutTests/fast/dom/custom/registration-context-delete-during-register-base-constructor-retrieval-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698