OLD | NEW |
1 // Copyright 2016 the Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef ComputedStylePropertyMap_h | 5 #ifndef ComputedStylePropertyMap_h |
6 #define ComputedStylePropertyMap_h | 6 #define ComputedStylePropertyMap_h |
7 | 7 |
8 #include "core/css/CSSComputedStyleDeclaration.h" | 8 #include "core/css/CSSComputedStyleDeclaration.h" |
9 #include "core/css/cssom/StylePropertyMapReadonly.h" | 9 #include "core/css/cssom/StylePropertyMapReadonly.h" |
10 #include "core/dom/Node.h" | 10 #include "core/dom/Node.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 public: | 26 public: |
27 static ComputedStylePropertyMap* create(Node* node, | 27 static ComputedStylePropertyMap* create(Node* node, |
28 const String& pseudoElement) { | 28 const String& pseudoElement) { |
29 return new ComputedStylePropertyMap(node, pseudoElement); | 29 return new ComputedStylePropertyMap(node, pseudoElement); |
30 } | 30 } |
31 | 31 |
32 Vector<String> getProperties() override; | 32 Vector<String> getProperties() override; |
33 | 33 |
34 DEFINE_INLINE_VIRTUAL_TRACE() { | 34 DEFINE_INLINE_VIRTUAL_TRACE() { |
35 visitor->trace(m_computedStyleDeclaration); | |
36 visitor->trace(m_node); | 35 visitor->trace(m_node); |
37 StylePropertyMapReadonly::trace(visitor); | 36 StylePropertyMapReadonly::trace(visitor); |
38 } | 37 } |
39 | 38 |
40 private: | |
41 Node* node() const; | |
42 | |
43 protected: | 39 protected: |
44 ComputedStylePropertyMap(Node* node, const String& pseudoElement = String()) | 40 ComputedStylePropertyMap(Node* node, const String& pseudoElement = String()) |
45 : StylePropertyMapReadonly(), | 41 : StylePropertyMapReadonly(), |
46 m_computedStyleDeclaration( | |
47 CSSComputedStyleDeclaration::create(node, false, pseudoElement)), | |
48 m_pseudoId(CSSSelector::parsePseudoId(pseudoElement)), | 42 m_pseudoId(CSSSelector::parsePseudoId(pseudoElement)), |
49 m_node(node) {} | 43 m_node(node) {} |
50 | 44 |
51 CSSStyleValueVector getAllInternal(CSSPropertyID) override; | 45 CSSStyleValueVector getAllInternal(CSSPropertyID) override; |
52 CSSStyleValueVector getAllInternal(AtomicString customPropertyName) override; | 46 CSSStyleValueVector getAllInternal(AtomicString customPropertyName) override; |
53 | 47 |
54 HeapVector<StylePropertyMapEntry> getIterationEntries() override { | 48 HeapVector<StylePropertyMapEntry> getIterationEntries() override { |
55 return HeapVector<StylePropertyMapEntry>(); | 49 return HeapVector<StylePropertyMapEntry>(); |
56 } | 50 } |
57 | 51 |
58 Member<CSSComputedStyleDeclaration> m_computedStyleDeclaration; | 52 private: |
| 53 Node* node() const; |
| 54 |
59 PseudoId m_pseudoId; | 55 PseudoId m_pseudoId; |
60 Member<Node> m_node; | 56 Member<Node> m_node; |
61 }; | 57 }; |
62 | 58 |
63 } // namespace blink | 59 } // namespace blink |
64 | 60 |
65 #endif | 61 #endif |
OLD | NEW |