Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.h |
| diff --git a/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.h b/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.h |
| index 0475e698c82fb508c696a6440ef0fdc8f7606aee..6fb8e019a2fa6842dd0c2c3e4476f6672473a9d4 100644 |
| --- a/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.h |
| +++ b/third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.h |
| @@ -7,6 +7,8 @@ |
| #include "core/css/CSSComputedStyleDeclaration.h" |
| #include "core/css/cssom/ImmutableStylePropertyMap.h" |
| +#include "core/dom/Node.h" |
| +#include "core/layout/LayoutObject.h" |
| namespace blink { |
| @@ -14,23 +16,29 @@ class CORE_EXPORT ComputedStylePropertyMap : public ImmutableStylePropertyMap { |
| WTF_MAKE_NONCOPYABLE(ComputedStylePropertyMap); |
| public: |
| - static ComputedStylePropertyMap* create( |
| - CSSComputedStyleDeclaration* computedStyleDeclaration) { |
| - return new ComputedStylePropertyMap(computedStyleDeclaration); |
| + static ComputedStylePropertyMap* create(Node* node, |
| + const String& pseudoElement) { |
| + return new ComputedStylePropertyMap(node, pseudoElement); |
| } |
| Vector<String> getProperties() override; |
| DEFINE_INLINE_VIRTUAL_TRACE() { |
| visitor->trace(m_computedStyleDeclaration); |
| + visitor->trace(m_node); |
| ImmutableStylePropertyMap::trace(visitor); |
| } |
| + private: |
| + Node* node() const; |
| + |
| protected: |
| - ComputedStylePropertyMap( |
| - CSSComputedStyleDeclaration* computedStyleDeclaration) |
| + ComputedStylePropertyMap(Node* node, const String& pseudoElement = String()) |
| : ImmutableStylePropertyMap(), |
| - m_computedStyleDeclaration(computedStyleDeclaration) {} |
| + m_computedStyleDeclaration( |
| + CSSComputedStyleDeclaration::create(node, false, pseudoElement)), |
| + m_pseudoId(CSSSelector::parsePseudoId(pseudoElement)), |
| + m_node(node) {} |
| CSSStyleValueVector getAllInternal(CSSPropertyID) override; |
| CSSStyleValueVector getAllInternal(AtomicString customPropertyName) override; |
| @@ -39,7 +47,9 @@ class CORE_EXPORT ComputedStylePropertyMap : public ImmutableStylePropertyMap { |
| return HeapVector<StylePropertyMapEntry>(); |
| } |
| - Member<CSSStyleDeclaration> m_computedStyleDeclaration; |
| + Member<CSSComputedStyleDeclaration> m_computedStyleDeclaration; |
| + PseudoId m_pseudoId; |
| + Member<Node> m_node; |
|
sashab
2017/01/17 01:12:38
Basically here's how I feel about passing around N
|
| }; |
| } // namespace blink |