OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 localName = m_extendsTagName.lower(); | 84 localName = m_extendsTagName.lower(); |
85 | 85 |
86 Dart_Handle nativeElement = DartUtilities::getAndValidateNativeType(m_cu
stomType, m_extendsTagName); | 86 Dart_Handle nativeElement = DartUtilities::getAndValidateNativeType(m_cu
stomType, m_extendsTagName); |
87 if (!nativeElement || Dart_IsNull(nativeElement)) { | 87 if (!nativeElement || Dart_IsNull(nativeElement)) { |
88 CustomElementException::throwException(CustomElementException::Exten
dsIsInvalidName, type, es); | 88 CustomElementException::throwException(CustomElementException::Exten
dsIsInvalidName, type, es); |
89 return false; | 89 return false; |
90 } | 90 } |
91 | 91 |
92 m_nativeClassId = reinterpret_cast<intptr_t>(DartDOMWrapper::readNativeP
ointer(nativeElement, DartDOMWrapper::kNativeTypeIndex)); | 92 m_nativeClassId = reinterpret_cast<intptr_t>(DartDOMWrapper::readNativeP
ointer(nativeElement, DartDOMWrapper::kNativeTypeIndex)); |
93 | 93 |
94 // TODO: enable once we pick up Blink version 31 | 94 if (!Document::isValidName(localName)) { |
95 // if (!Document::isValidName(localName)) { | 95 CustomElementException::throwException(CustomElementException::Exten
dsIsInvalidName, type, es); |
96 // CustomElementException::throwException(CustomElementException::Ex
tendsIsInvalidName, type, es); | 96 return false; |
97 // return false; | 97 } |
98 // } | 98 if (CustomElement::isValidName(localName)) { |
99 // if (CustomElement::isValidName(localName)) { | 99 CustomElementException::throwException(CustomElementException::Exten
dsIsCustomElementName, type, es); |
100 // CustomElementException::throwException(CustomElementException::Ex
tendsIsCustomElementName, type, es); | 100 return false; |
101 // return false; | 101 } |
102 // } | |
103 } else { | 102 } else { |
104 localName = type; | 103 localName = type; |
105 m_nativeClassId = DartHTMLElement::dartClassId; | 104 m_nativeClassId = DartHTMLElement::dartClassId; |
106 } | 105 } |
107 | 106 |
108 m_localName = localName; | 107 m_localName = localName; |
109 m_namespaceURI = namespaceURI; | 108 m_namespaceURI = namespaceURI; |
110 findTagName(type, tagName); | 109 findTagName(type, tagName); |
111 return true; | 110 return true; |
112 } | 111 } |
(...skipping 25 matching lines...) Expand all Loading... |
138 { | 137 { |
139 return m_callbacks->setBinding(definition, DartCustomElementBinding::create(
m_customType, m_nativeClassId)); | 138 return m_callbacks->setBinding(definition, DartCustomElementBinding::create(
m_customType, m_nativeClassId)); |
140 } | 139 } |
141 | 140 |
142 ScriptValue DartCustomElementConstructorBuilder::bindingsReturnValue() const | 141 ScriptValue DartCustomElementConstructorBuilder::bindingsReturnValue() const |
143 { | 142 { |
144 // Dart does not return a constructor. | 143 // Dart does not return a constructor. |
145 return ScriptValue(); | 144 return ScriptValue(); |
146 } | 145 } |
147 } // namespace WebCore | 146 } // namespace WebCore |
OLD | NEW |