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