OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 if (!constructorBuilder->isFeatureAllowed()) { | 71 if (!constructorBuilder->isFeatureAllowed()) { |
72 CustomElementException::throwException(CustomElementException::CannotReg
isterFromExtension, type, es); | 72 CustomElementException::throwException(CustomElementException::CannotReg
isterFromExtension, type, es); |
73 return 0; | 73 return 0; |
74 } | 74 } |
75 | 75 |
76 if (!CustomElement::isValidName(type, validNames)) { | 76 if (!CustomElement::isValidName(type, validNames)) { |
77 CustomElementException::throwException(CustomElementException::InvalidNa
me, type, es); | 77 CustomElementException::throwException(CustomElementException::InvalidNa
me, type, es); |
78 return 0; | 78 return 0; |
79 } | 79 } |
80 | 80 |
81 if (!constructorBuilder->validateOptions(type, es)) | 81 QualifiedName tagName = nullQName(); |
| 82 if (!constructorBuilder->validateOptions(type, tagName, es)) |
82 return 0; | 83 return 0; |
83 | 84 |
84 QualifiedName tagName = nullQName(); | |
85 if (!constructorBuilder->findTagName(type, tagName)) { | |
86 CustomElementException::throwException(CustomElementException::Prototype
DoesNotExtendHTMLElementSVGElementNamespace, type, es); | |
87 return 0; | |
88 } | |
89 ASSERT(tagName.namespaceURI() == HTMLNames::xhtmlNamespaceURI || tagName.nam
espaceURI() == SVGNames::svgNamespaceURI); | 85 ASSERT(tagName.namespaceURI() == HTMLNames::xhtmlNamespaceURI || tagName.nam
espaceURI() == SVGNames::svgNamespaceURI); |
90 | 86 |
| 87 // FIXME: This should be done earlier in validateOptions. |
91 if (m_registeredTypeNames.contains(type)) { | 88 if (m_registeredTypeNames.contains(type)) { |
92 CustomElementException::throwException(CustomElementException::TypeAlrea
dyRegistered, type, es); | 89 CustomElementException::throwException(CustomElementException::TypeAlrea
dyRegistered, type, es); |
93 return 0; | 90 return 0; |
94 } | 91 } |
95 | 92 |
96 ASSERT(!observer.registrationContextWentAway()); | 93 ASSERT(!observer.registrationContextWentAway()); |
97 | 94 |
98 RefPtr<CustomElementLifecycleCallbacks> lifecycleCallbacks = constructorBuil
der->createCallbacks(); | 95 RefPtr<CustomElementLifecycleCallbacks> lifecycleCallbacks = constructorBuil
der->createCallbacks(); |
99 | 96 |
100 // Consulting the constructor builder could execute script and | 97 // Consulting the constructor builder could execute script and |
(...skipping 19 matching lines...) Expand all Loading... |
120 | 117 |
121 return definition.get(); | 118 return definition.get(); |
122 } | 119 } |
123 | 120 |
124 CustomElementDefinition* CustomElementRegistry::find(const CustomElementDescript
or& descriptor) const | 121 CustomElementDefinition* CustomElementRegistry::find(const CustomElementDescript
or& descriptor) const |
125 { | 122 { |
126 return m_definitions.get(descriptor); | 123 return m_definitions.get(descriptor); |
127 } | 124 } |
128 | 125 |
129 } // namespace WebCore | 126 } // namespace WebCore |
OLD | NEW |