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

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

Issue 2312293003: [CSSTypedOM] Computed StylePropertyMap use ComputedStyle for Lengths (Closed)
Patch Set: Rebase Created 4 years, 3 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(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_node(node) { m_computedStyleDeclaration = CSSComputedStyleDeclaratio n::create(node, false, pseudoElement); }
meade_UTC10 2016/09/22 05:34:35 Nit: It'd be nice to put this on a new line, or yo
rjwright 2016/09/23 04:50:04 Done.
34 37
35 CSSStyleValueVector getAllInternal(CSSPropertyID) override; 38 CSSStyleValueVector getAllInternal(CSSPropertyID) override;
36 CSSStyleValueVector getAllInternal(AtomicString customPropertyName) override ; 39 CSSStyleValueVector getAllInternal(AtomicString customPropertyName) override ;
37 40
38 HeapVector<StylePropertyMapEntry> getIterationEntries() override { return He apVector<StylePropertyMapEntry>(); } 41 HeapVector<StylePropertyMapEntry> getIterationEntries() override { return He apVector<StylePropertyMapEntry>(); }
39 42
40 Member<CSSStyleDeclaration> m_computedStyleDeclaration; 43 Member<CSSStyleDeclaration> m_computedStyleDeclaration;
44 Member<Node> m_node;
41 }; 45 };
42 46
43 } // namespace blink 47 } // namespace blink
44 48
45 #endif 49 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698