Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: third_party/WebKit/Source/core/css/cssom/ComputedStylePropertyMap.h

Issue 2403423002: [CSSTypedOM] Computed StylePropertyMap use ComputedStyle for Lengths (Closed)
Patch Set: sasha's comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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( 19 static ComputedStylePropertyMap* create(Node* node,
18 CSSComputedStyleDeclaration* computedStyleDeclaration) { 20 const String& pseudoElement) {
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 visitor->trace(m_computedStyleDeclaration); 27 visitor->trace(m_computedStyleDeclaration);
28 visitor->trace(m_node);
26 ImmutableStylePropertyMap::trace(visitor); 29 ImmutableStylePropertyMap::trace(visitor);
27 } 30 }
28 31
32 private:
33 Node* node() const;
34
29 protected: 35 protected:
30 ComputedStylePropertyMap( 36 ComputedStylePropertyMap(Node* node, const String& pseudoElement = String())
31 CSSComputedStyleDeclaration* computedStyleDeclaration)
32 : ImmutableStylePropertyMap(), 37 : ImmutableStylePropertyMap(),
33 m_computedStyleDeclaration(computedStyleDeclaration) {} 38 m_computedStyleDeclaration(
39 CSSComputedStyleDeclaration::create(node, false, pseudoElement)),
40 m_pseudoId(CSSSelector::parsePseudoId(pseudoElement)),
41 m_node(node) {}
34 42
35 CSSStyleValueVector getAllInternal(CSSPropertyID) override; 43 CSSStyleValueVector getAllInternal(CSSPropertyID) override;
36 CSSStyleValueVector getAllInternal(AtomicString customPropertyName) override; 44 CSSStyleValueVector getAllInternal(AtomicString customPropertyName) override;
37 45
38 HeapVector<StylePropertyMapEntry> getIterationEntries() override { 46 HeapVector<StylePropertyMapEntry> getIterationEntries() override {
39 return HeapVector<StylePropertyMapEntry>(); 47 return HeapVector<StylePropertyMapEntry>();
40 } 48 }
41 49
42 Member<CSSStyleDeclaration> m_computedStyleDeclaration; 50 Member<CSSComputedStyleDeclaration> m_computedStyleDeclaration;
51 PseudoId m_pseudoId;
52 Member<Node> m_node;
sashab 2017/01/17 01:12:38 Basically here's how I feel about passing around N
43 }; 53 };
44 54
45 } // namespace blink 55 } // namespace blink
46 56
47 #endif 57 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698