diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/bindings/v8/CustomElementConstructorBuilder.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/bindings/v8/CustomElementConstructorBuilder.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/chromium/third_party/WebKit/Source/bindings/v8/CustomElementConstructorBuilder.cpp b/chromium/third_party/WebKit/Source/bindings/v8/CustomElementConstructorBuilder.cpp index b808512b8a9..02fd9273e7a 100644 --- a/chromium/third_party/WebKit/Source/bindings/v8/CustomElementConstructorBuilder.cpp +++ b/chromium/third_party/WebKit/Source/bindings/v8/CustomElementConstructorBuilder.cpp @@ -47,7 +47,6 @@ #include "core/dom/CustomElementCallbackDispatcher.h" #include "core/dom/CustomElementDefinition.h" #include "core/dom/CustomElementDescriptor.h" -#include "core/dom/CustomElementException.h" #include "core/dom/Document.h" #include "wtf/Assertions.h" @@ -69,7 +68,7 @@ bool CustomElementConstructorBuilder::isFeatureAllowed() const return !DOMWrapperWorld::isolatedWorld(m_context); } -bool CustomElementConstructorBuilder::validateOptions(const AtomicString& type, ExceptionState& es) +bool CustomElementConstructorBuilder::validateOptions() { ASSERT(m_prototype.IsEmpty()); @@ -80,21 +79,17 @@ bool CustomElementConstructorBuilder::validateOptions(const AtomicString& type, // is HTMLSpanElement.prototype, has an ambiguity about its // behavior. The spec should be fixed before WebKit implements // it. https://www.w3.org/Bugs/Public/show_bug.cgi?id=20801 - CustomElementException::throwException(CustomElementException::NotYetImplemented, type, es); return false; } v8::Handle<v8::Value> prototypeValue = prototypeScriptValue.v8Value(); - if (prototypeValue.IsEmpty() || !prototypeValue->IsObject()) { - CustomElementException::throwException(CustomElementException::PrototypeNotAnObject, type, es); + if (prototypeValue.IsEmpty() || !prototypeValue->IsObject()) return false; - } m_prototype = prototypeValue.As<v8::Object>(); V8PerContextData* perContextData; if (!(perContextData = V8PerContextData::from(m_context))) { // FIXME: This should generate an InvalidContext exception at a later point. - CustomElementException::throwException(CustomElementException::ContextDestroyedCheckingPrototype, type, es); return false; } @@ -114,7 +109,6 @@ bool CustomElementConstructorBuilder::validateOptions(const AtomicString& type, return true; } - CustomElementException::throwException(CustomElementException::PrototypeDoesNotExtendHTMLElementSVGElementPrototype, type, es); return false; } @@ -176,7 +170,7 @@ v8::Handle<v8::Function> CustomElementConstructorBuilder::retrieveCallback(v8::I return value.As<v8::Function>(); } -bool CustomElementConstructorBuilder::createConstructor(Document* document, CustomElementDefinition* definition, ExceptionState& es) +bool CustomElementConstructorBuilder::createConstructor(Document* document, CustomElementDefinition* definition) { ASSERT(!m_prototype.IsEmpty()); ASSERT(m_constructor.IsEmpty()); @@ -184,16 +178,14 @@ bool CustomElementConstructorBuilder::createConstructor(Document* document, Cust v8::Isolate* isolate = m_context->GetIsolate(); - if (!prototypeIsValid(definition->descriptor().type(), es)) + if (!prototypeIsValid()) return false; v8::Local<v8::FunctionTemplate> constructorTemplate = v8::FunctionTemplate::New(); constructorTemplate->SetCallHandler(constructCustomElement); m_constructor = constructorTemplate->GetFunction(); - if (m_constructor.IsEmpty()) { - CustomElementException::throwException(CustomElementException::ContextDestroyedRegisteringDefinition, definition->descriptor().type(), es); + if (m_constructor.IsEmpty()) return false; - } const CustomElementDescriptor& descriptor = definition->descriptor(); @@ -228,15 +220,15 @@ bool CustomElementConstructorBuilder::createConstructor(Document* document, Cust return true; } -bool CustomElementConstructorBuilder::prototypeIsValid(const AtomicString& type, ExceptionState& es) const +bool CustomElementConstructorBuilder::prototypeIsValid() const { if (m_prototype->InternalFieldCount() || !m_prototype->GetHiddenValue(V8HiddenPropertyName::customElementIsInterfacePrototypeObject()).IsEmpty()) { - CustomElementException::throwException(CustomElementException::PrototypeInUse, type, es); + // Alcreated an interface prototype object. return false; } if (m_prototype->GetPropertyAttributes(v8String("constructor", m_context->GetIsolate())) & v8::DontDelete) { - CustomElementException::throwException(CustomElementException::ConstructorPropertyNotConfigurable, type, es); + // "constructor" is not configurable. return false; } |