| 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/ImmutableStylePropertyMap.h" | 9 #include "core/css/cssom/ImmutableStylePropertyMap.h" |
| 10 #include "core/dom/Node.h" |
| 11 #include "core/layout/LayoutObject.h" |
| 10 | 12 |
| 11 namespace blink { | 13 namespace blink { |
| 12 | 14 |
| 13 class CORE_EXPORT ComputedStylePropertyMap : public ImmutableStylePropertyMap { | 15 class CORE_EXPORT ComputedStylePropertyMap : public ImmutableStylePropertyMap { |
| 14 WTF_MAKE_NONCOPYABLE(ComputedStylePropertyMap); | 16 WTF_MAKE_NONCOPYABLE(ComputedStylePropertyMap); |
| 15 | 17 |
| 16 public: | 18 public: |
| 17 static ComputedStylePropertyMap* create(CSSComputedStyleDeclaration* compute
dStyleDeclaration) | 19 static ComputedStylePropertyMap* create(Node* node, const String& pseudoElem
ent) |
| 18 { | 20 { |
| 19 return new ComputedStylePropertyMap(computedStyleDeclaration); | 21 return new ComputedStylePropertyMap(node, pseudoElement); |
| 20 } | 22 } |
| 21 | 23 |
| 22 Vector<String> getProperties() override; | 24 Vector<String> getProperties() override; |
| 23 | 25 |
| 24 DEFINE_INLINE_VIRTUAL_TRACE() | 26 DEFINE_INLINE_VIRTUAL_TRACE() |
| 25 { | 27 { |
| 26 visitor->trace(m_computedStyleDeclaration); | 28 visitor->trace(m_computedStyleDeclaration); |
| 29 visitor->trace(m_node); |
| 27 ImmutableStylePropertyMap::trace(visitor); | 30 ImmutableStylePropertyMap::trace(visitor); |
| 28 } | 31 } |
| 29 | 32 |
| 30 protected: | 33 protected: |
| 31 ComputedStylePropertyMap(CSSComputedStyleDeclaration* computedStyleDeclarati
on) | 34 ComputedStylePropertyMap(Node* node, const String& pseudoElement = String()) |
| 32 : ImmutableStylePropertyMap() | 35 : ImmutableStylePropertyMap() |
| 33 , m_computedStyleDeclaration(computedStyleDeclaration) { } | 36 , m_computedStyleDeclaration(CSSComputedStyleDeclaration::create(node, f
alse, pseudoElement)) |
| 37 , m_node(node) {} |
| 34 | 38 |
| 35 CSSStyleValueVector getAllInternal(CSSPropertyID) override; | 39 CSSStyleValueVector getAllInternal(CSSPropertyID) override; |
| 36 CSSStyleValueVector getAllInternal(AtomicString customPropertyName) override
; | 40 CSSStyleValueVector getAllInternal(AtomicString customPropertyName) override
; |
| 37 | 41 |
| 38 HeapVector<StylePropertyMapEntry> getIterationEntries() override { return He
apVector<StylePropertyMapEntry>(); } | 42 HeapVector<StylePropertyMapEntry> getIterationEntries() override { return He
apVector<StylePropertyMapEntry>(); } |
| 39 | 43 |
| 40 Member<CSSStyleDeclaration> m_computedStyleDeclaration; | 44 Member<CSSStyleDeclaration> m_computedStyleDeclaration; |
| 45 Member<Node> m_node; |
| 41 }; | 46 }; |
| 42 | 47 |
| 43 } // namespace blink | 48 } // namespace blink |
| 44 | 49 |
| 45 #endif | 50 #endif |
| OLD | NEW |