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 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "core/dom/custom/V0CustomElementRegistry.h" | 31 #include "core/dom/custom/V0CustomElementRegistry.h" |
32 | 32 |
33 #include "bindings/core/v8/V0CustomElementConstructorBuilder.h" | 33 #include "bindings/core/v8/V0CustomElementConstructorBuilder.h" |
34 #include "bindings/core/v8/V8Binding.h" | 34 #include "bindings/core/v8/V8Binding.h" |
35 #include "core/HTMLNames.h" | 35 #include "core/HTMLNames.h" |
36 #include "core/SVGNames.h" | 36 #include "core/SVGNames.h" |
37 #include "core/dom/Document.h" | 37 #include "core/dom/Document.h" |
38 #include "core/dom/custom/CustomElementsRegistry.h" | 38 #include "core/dom/custom/CustomElementRegistry.h" |
39 #include "core/dom/custom/V0CustomElementException.h" | 39 #include "core/dom/custom/V0CustomElementException.h" |
40 #include "core/dom/custom/V0CustomElementRegistrationContext.h" | 40 #include "core/dom/custom/V0CustomElementRegistrationContext.h" |
41 #include "core/frame/LocalDOMWindow.h" | 41 #include "core/frame/LocalDOMWindow.h" |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 V0CustomElementDefinition* V0CustomElementRegistry::registerElement(Document* do
cument, V0CustomElementConstructorBuilder* constructorBuilder, const AtomicStrin
g& userSuppliedName, V0CustomElement::NameSet validNames, ExceptionState& except
ionState) | 45 V0CustomElementDefinition* V0CustomElementRegistry::registerElement(Document* do
cument, V0CustomElementConstructorBuilder* constructorBuilder, const AtomicStrin
g& userSuppliedName, V0CustomElement::NameSet validNames, ExceptionState& except
ionState) |
46 { | 46 { |
47 AtomicString type = userSuppliedName.lower(); | 47 AtomicString type = userSuppliedName.lower(); |
48 | 48 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 V0CustomElementDefinition* V0CustomElementRegistry::find(const V0CustomElementDe
scriptor& descriptor) const | 98 V0CustomElementDefinition* V0CustomElementRegistry::find(const V0CustomElementDe
scriptor& descriptor) const |
99 { | 99 { |
100 return m_definitions.get(descriptor); | 100 return m_definitions.get(descriptor); |
101 } | 101 } |
102 | 102 |
103 bool V0CustomElementRegistry::nameIsDefined(const AtomicString& name) const | 103 bool V0CustomElementRegistry::nameIsDefined(const AtomicString& name) const |
104 { | 104 { |
105 return m_registeredTypeNames.contains(name); | 105 return m_registeredTypeNames.contains(name); |
106 } | 106 } |
107 | 107 |
108 void V0CustomElementRegistry::setV1(const CustomElementsRegistry* v1) | 108 void V0CustomElementRegistry::setV1(const CustomElementRegistry* v1) |
109 { | 109 { |
110 DCHECK(!m_v1.get()); | 110 DCHECK(!m_v1.get()); |
111 m_v1 = v1; | 111 m_v1 = v1; |
112 } | 112 } |
113 | 113 |
114 bool V0CustomElementRegistry::v1NameIsDefined(const AtomicString& name) const | 114 bool V0CustomElementRegistry::v1NameIsDefined(const AtomicString& name) const |
115 { | 115 { |
116 return m_v1.get() && m_v1->nameIsDefined(name); | 116 return m_v1.get() && m_v1->nameIsDefined(name); |
117 } | 117 } |
118 | 118 |
119 DEFINE_TRACE(V0CustomElementRegistry) | 119 DEFINE_TRACE(V0CustomElementRegistry) |
120 { | 120 { |
121 visitor->trace(m_definitions); | 121 visitor->trace(m_definitions); |
122 visitor->trace(m_v1); | 122 visitor->trace(m_v1); |
123 } | 123 } |
124 | 124 |
125 } // namespace blink | 125 } // namespace blink |
OLD | NEW |