OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/html/RelList.h" | 5 #include "core/html/RelList.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "wtf/HashMap.h" | 8 #include "wtf/HashMap.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 using namespace HTMLNames; | 12 using namespace HTMLNames; |
13 | 13 |
14 | 14 |
15 RelList::RelList(Element* element) : m_element(element) { } | 15 RelList::RelList(Element* element) : DOMTokenList(nullptr), m_element(element) {
} |
16 | |
17 #if !ENABLE(OILPAN) | |
18 void RelList::ref() | |
19 { | |
20 m_element->ref(); | |
21 } | |
22 | |
23 void RelList::deref() | |
24 { | |
25 m_element->deref(); | |
26 } | |
27 #endif | |
28 | 16 |
29 unsigned RelList::length() const | 17 unsigned RelList::length() const |
30 { | 18 { |
31 return !m_element->fastGetAttribute(relAttr).isEmpty() ? m_relValues.size()
: 0; | 19 return !m_element->fastGetAttribute(relAttr).isEmpty() ? m_relValues.size()
: 0; |
32 } | 20 } |
33 | 21 |
34 const AtomicString RelList::item(unsigned index) const | 22 const AtomicString RelList::item(unsigned index) const |
35 { | 23 { |
36 if (index >= length()) | 24 if (index >= length()) |
37 return AtomicString(); | 25 return AtomicString(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 return supportedTokens().contains(tokenValue); | 63 return supportedTokens().contains(tokenValue); |
76 } | 64 } |
77 | 65 |
78 DEFINE_TRACE(RelList) | 66 DEFINE_TRACE(RelList) |
79 { | 67 { |
80 visitor->trace(m_element); | 68 visitor->trace(m_element); |
81 DOMTokenList::trace(visitor); | 69 DOMTokenList::trace(visitor); |
82 } | 70 } |
83 | 71 |
84 } // namespace blink | 72 } // namespace blink |
OLD | NEW |