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 10 matching lines...) Expand all Loading... |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
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 #ifndef CustomElementDescriptor_h | 31 #ifndef V0CustomElementDescriptor_h |
32 #define CustomElementDescriptor_h | 32 #define V0CustomElementDescriptor_h |
33 | 33 |
34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
35 #include "wtf/HashTableDeletedValueType.h" | 35 #include "wtf/HashTableDeletedValueType.h" |
36 #include "wtf/text/AtomicString.h" | 36 #include "wtf/text/AtomicString.h" |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 struct CustomElementDescriptorHash; | 40 struct V0CustomElementDescriptorHash; |
41 | 41 |
42 // A Custom Element descriptor is everything necessary to match a | 42 // A Custom Element descriptor is everything necessary to match a |
43 // Custom Element instance to a definition. | 43 // Custom Element instance to a definition. |
44 class CustomElementDescriptor { | 44 class V0CustomElementDescriptor { |
45 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 45 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
46 public: | 46 public: |
47 CustomElementDescriptor(const AtomicString& type, const AtomicString& namesp
aceURI, const AtomicString& localName) | 47 V0CustomElementDescriptor(const AtomicString& type, const AtomicString& name
spaceURI, const AtomicString& localName) |
48 : m_type(type) | 48 : m_type(type) |
49 , m_namespaceURI(namespaceURI) | 49 , m_namespaceURI(namespaceURI) |
50 , m_localName(localName) | 50 , m_localName(localName) |
51 { | 51 { |
52 } | 52 } |
53 | 53 |
54 ~CustomElementDescriptor() { } | 54 ~V0CustomElementDescriptor() { } |
55 | 55 |
56 // Specifies whether the custom element is in the HTML or SVG | 56 // Specifies whether the custom element is in the HTML or SVG |
57 // namespace. | 57 // namespace. |
58 const AtomicString& namespaceURI() const { return m_namespaceURI; } | 58 const AtomicString& namespaceURI() const { return m_namespaceURI; } |
59 | 59 |
60 // The tag name. | 60 // The tag name. |
61 const AtomicString& localName() const { return m_localName; } | 61 const AtomicString& localName() const { return m_localName; } |
62 | 62 |
63 // The name of the definition. For custom tags, this is the tag | 63 // The name of the definition. For custom tags, this is the tag |
64 // name and the same as "localName". For type extensions, this is | 64 // name and the same as "localName". For type extensions, this is |
65 // the value of the "is" attribute. | 65 // the value of the "is" attribute. |
66 const AtomicString& type() const { return m_type; } | 66 const AtomicString& type() const { return m_type; } |
67 | 67 |
68 bool isTypeExtension() const { return m_type != m_localName; } | 68 bool isTypeExtension() const { return m_type != m_localName; } |
69 | 69 |
70 // Stuff for hashing. | 70 // Stuff for hashing. |
71 | 71 |
72 CustomElementDescriptor() { } | 72 V0CustomElementDescriptor() { } |
73 explicit CustomElementDescriptor(WTF::HashTableDeletedValueType value) | 73 explicit V0CustomElementDescriptor(WTF::HashTableDeletedValueType value) |
74 : m_type(value) { } | 74 : m_type(value) { } |
75 bool isHashTableDeletedValue() const { return m_type.isHashTableDeletedValue
(); } | 75 bool isHashTableDeletedValue() const { return m_type.isHashTableDeletedValue
(); } |
76 | 76 |
77 bool operator==(const CustomElementDescriptor& other) const | 77 bool operator==(const V0CustomElementDescriptor& other) const |
78 { | 78 { |
79 return m_type == other.m_type | 79 return m_type == other.m_type |
80 && m_localName == other.m_localName | 80 && m_localName == other.m_localName |
81 && m_namespaceURI == other.m_namespaceURI; | 81 && m_namespaceURI == other.m_namespaceURI; |
82 } | 82 } |
83 | 83 |
84 private: | 84 private: |
85 AtomicString m_type; | 85 AtomicString m_type; |
86 AtomicString m_namespaceURI; | 86 AtomicString m_namespaceURI; |
87 AtomicString m_localName; | 87 AtomicString m_localName; |
88 }; | 88 }; |
89 | 89 |
90 } // namespace blink | 90 } // namespace blink |
91 | 91 |
92 namespace WTF { | 92 namespace WTF { |
93 | 93 |
94 template<> struct DefaultHash<blink::CustomElementDescriptor> { | 94 template<> struct DefaultHash<blink::V0CustomElementDescriptor> { |
95 typedef blink::CustomElementDescriptorHash Hash; | 95 typedef blink::V0CustomElementDescriptorHash Hash; |
96 }; | 96 }; |
97 | 97 |
98 } // namespace WTF | 98 } // namespace WTF |
99 | 99 |
100 #endif // CustomElementDescriptor_h | 100 #endif // V0CustomElementDescriptor_h |
OLD | NEW |