| Index: Source/bindings/dart/DartCustomElementConstructorBuilder.cpp
|
| diff --git a/Source/bindings/dart/DartCustomElementConstructorBuilder.cpp b/Source/bindings/dart/DartCustomElementConstructorBuilder.cpp
|
| index 0cec8815076954f7ab5dcb1d7bf64f43f50e0b66..fd1aff95f9bb7761b1986e0cd4f50f7cdbe76a4e 100644
|
| --- a/Source/bindings/dart/DartCustomElementConstructorBuilder.cpp
|
| +++ b/Source/bindings/dart/DartCustomElementConstructorBuilder.cpp
|
| @@ -31,11 +31,14 @@
|
| #include "config.h"
|
| #include "bindings/dart/DartCustomElementConstructorBuilder.h"
|
|
|
| +#include "DartHTMLElement.h"
|
| +#include "DartWebkitClassIds.h"
|
| #include "HTMLNames.h"
|
| #include "SVGNames.h"
|
| #include "bindings/dart/DartCustomElementBinding.h"
|
| #include "bindings/dart/DartCustomElementLifecycleCallbacks.h"
|
| #include "bindings/dart/DartDOMData.h"
|
| +#include "bindings/dart/DartDOMWrapper.h"
|
| #include "bindings/dart/DartUtilities.h"
|
| #include "bindings/v8/V8Binding.h"
|
| #include "core/dom/CustomElementException.h"
|
| @@ -46,6 +49,7 @@ namespace WebCore {
|
| DartCustomElementConstructorBuilder::DartCustomElementConstructorBuilder(Dart_Handle customType, const AtomicString& extendsTagName, ScriptState* state, const Dictionary* options)
|
| : CustomElementConstructorBuilder(state, options)
|
| , m_customType(customType)
|
| + , m_nativeClassId(_InvalidClassId)
|
| , m_extendsTagName(extendsTagName)
|
| , m_isolate(Dart_CurrentIsolate())
|
| , m_context(state->context())
|
| @@ -79,11 +83,14 @@ bool DartCustomElementConstructorBuilder::validateOptions(const AtomicString& ty
|
| if (!m_extendsTagName.isNull() && !m_extendsTagName.isEmpty()) {
|
| localName = m_extendsTagName.lower();
|
|
|
| - if (!DartUtilities::isTypeSubclassOfTag(m_customType, m_extendsTagName)) {
|
| + Dart_Handle nativeElement = DartUtilities::getAndValidateNativeType(m_customType, m_extendsTagName);
|
| + if (!nativeElement || Dart_IsNull(nativeElement)) {
|
| CustomElementException::throwException(CustomElementException::PrototypeDoesNotExtendHTMLElementSVGElementPrototype, type, es);
|
| return false;
|
| }
|
|
|
| + m_nativeClassId = reinterpret_cast<intptr_t>(DartDOMWrapper::readNativePointer(nativeElement, DartDOMWrapper::kNativeTypeIndex));
|
| +
|
| // TODO: enable once we pick up Blink version 31
|
| // if (!Document::isValidName(localName)) {
|
| // CustomElementException::throwException(CustomElementException::ExtendsIsInvalidName, type, es);
|
| @@ -95,6 +102,7 @@ bool DartCustomElementConstructorBuilder::validateOptions(const AtomicString& ty
|
| // }
|
| } else {
|
| localName = type;
|
| + m_nativeClassId = DartHTMLElement::dartClassId;
|
| }
|
|
|
| m_localName = localName;
|
| @@ -127,7 +135,7 @@ bool DartCustomElementConstructorBuilder::createConstructor(Document* document,
|
|
|
| bool DartCustomElementConstructorBuilder::didRegisterDefinition(CustomElementDefinition* definition) const
|
| {
|
| - return m_callbacks->setBinding(definition, DartCustomElementBinding::create(m_customType));
|
| + return m_callbacks->setBinding(definition, DartCustomElementBinding::create(m_customType, m_nativeClassId));
|
| }
|
|
|
| ScriptValue DartCustomElementConstructorBuilder::bindingsReturnValue() const
|
|
|