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

Unified Diff: sky/engine/bindings/core/v8/CustomElementConstructorBuilder.cpp

Issue 831993005: Remove custom element type extensions. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | sky/engine/bindings/core/v8/V8HiddenValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/bindings/core/v8/CustomElementConstructorBuilder.cpp
diff --git a/sky/engine/bindings/core/v8/CustomElementConstructorBuilder.cpp b/sky/engine/bindings/core/v8/CustomElementConstructorBuilder.cpp
index 618d570ab1ecfca46e5be9edc26834c5ff4fa6a4..a5aabc2aa7b1dd068c4df3b165a705abf78c3640 100644
--- a/sky/engine/bindings/core/v8/CustomElementConstructorBuilder.cpp
+++ b/sky/engine/bindings/core/v8/CustomElementConstructorBuilder.cpp
@@ -171,31 +171,25 @@ bool CustomElementConstructorBuilder::createConstructor(Document* document, Cust
v8::Isolate* isolate = m_scriptState->isolate();
- if (!prototypeIsValid(definition->descriptor().type(), exceptionState))
+ if (!prototypeIsValid(definition->descriptor().localName(), exceptionState))
return false;
v8::Local<v8::FunctionTemplate> constructorTemplate = v8::FunctionTemplate::New(isolate);
constructorTemplate->SetCallHandler(constructCustomElement);
m_constructor = constructorTemplate->GetFunction();
if (m_constructor.IsEmpty()) {
- CustomElementException::throwException(CustomElementException::ContextDestroyedRegisteringDefinition, definition->descriptor().type(), exceptionState);
+ CustomElementException::throwException(CustomElementException::ContextDestroyedRegisteringDefinition, definition->descriptor().localName(), exceptionState);
return false;
}
const CustomElementDescriptor& descriptor = definition->descriptor();
v8::Handle<v8::String> v8TagName = v8String(isolate, descriptor.localName());
- v8::Handle<v8::Value> v8Type;
- if (descriptor.isTypeExtension())
- v8Type = v8String(isolate, descriptor.type());
- else
- v8Type = v8::Null(isolate);
- m_constructor->SetName(v8Type->IsNull() ? v8TagName : v8Type.As<v8::String>());
+ m_constructor->SetName(v8TagName);
V8HiddenValue::setHiddenValue(isolate, m_constructor, V8HiddenValue::customElementDocument(isolate), toV8(document, m_scriptState->context()->Global(), isolate));
V8HiddenValue::setHiddenValue(isolate, m_constructor, V8HiddenValue::customElementTagName(isolate), v8TagName);
- V8HiddenValue::setHiddenValue(isolate, m_constructor, V8HiddenValue::customElementType(isolate), v8Type);
v8::Handle<v8::String> prototypeKey = v8String(isolate, "prototype");
v8::Handle<v8::String> constructorKey = v8String(isolate, "constructor");
@@ -277,12 +271,10 @@ static void constructCustomElement(const v8::FunctionCallbackInfo<v8::Value>& in
Document* document = V8Document::toNative(V8HiddenValue::getHiddenValue(info.GetIsolate(), info.Callee(), V8HiddenValue::customElementDocument(isolate)).As<v8::Object>());
TOSTRING_VOID(V8StringResource<>, tagName, V8HiddenValue::getHiddenValue(isolate, info.Callee(), V8HiddenValue::customElementTagName(isolate)));
- v8::Handle<v8::Value> maybeType = V8HiddenValue::getHiddenValue(info.GetIsolate(), info.Callee(), V8HiddenValue::customElementType(isolate));
- TOSTRING_VOID(V8StringResource<>, type, maybeType);
ExceptionState exceptionState(ExceptionState::ConstructionContext, "CustomElement", info.Holder(), info.GetIsolate());
CustomElementProcessingStack::CallbackDeliveryScope deliveryScope;
- RefPtr<Element> element = document->createElement(tagName, maybeType->IsNull() ? nullAtom : type, exceptionState);
+ RefPtr<Element> element = document->createElement(tagName, exceptionState);
if (exceptionState.throwIfNeeded())
return;
v8SetReturnValueFast(info, element.release(), document);
« no previous file with comments | « no previous file | sky/engine/bindings/core/v8/V8HiddenValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698