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

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

Issue 2791193004: [Typed CSSOM] New design for computed styles which includes custom properties (Closed)
Patch Set: replace node check with dcheck Created 3 years, 7 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/StylePropertyMapReadonly.h" 9 #include "core/css/cssom/StylePropertyMapReadonly.h"
10 #include "core/dom/Node.h" 10 #include "core/dom/Node.h"
(...skipping 14 matching lines...) Expand all
25 25
26 public: 26 public:
27 static ComputedStylePropertyMap* Create(Node* node, 27 static ComputedStylePropertyMap* Create(Node* node,
28 const String& pseudo_element) { 28 const String& pseudo_element) {
29 return new ComputedStylePropertyMap(node, pseudo_element); 29 return new ComputedStylePropertyMap(node, pseudo_element);
30 } 30 }
31 31
32 Vector<String> getProperties() override; 32 Vector<String> getProperties() override;
33 33
34 DEFINE_INLINE_VIRTUAL_TRACE() { 34 DEFINE_INLINE_VIRTUAL_TRACE() {
35 visitor->Trace(computed_style_declaration_);
36 visitor->Trace(node_); 35 visitor->Trace(node_);
37 StylePropertyMapReadonly::Trace(visitor); 36 StylePropertyMapReadonly::Trace(visitor);
38 } 37 }
39 38
40 private:
41 Node* GetNode() const;
42
43 protected: 39 protected:
44 ComputedStylePropertyMap(Node* node, const String& pseudo_element = String()) 40 ComputedStylePropertyMap(Node* node, const String& pseudo_element = String())
45 : StylePropertyMapReadonly(), 41 : StylePropertyMapReadonly(),
46 computed_style_declaration_(
47 CSSComputedStyleDeclaration::Create(node, false, pseudo_element)),
48 pseudo_id_(CSSSelector::ParsePseudoId(pseudo_element)), 42 pseudo_id_(CSSSelector::ParsePseudoId(pseudo_element)),
49 node_(node) {} 43 node_(node) {}
50 44
51 CSSStyleValueVector GetAllInternal(CSSPropertyID) override; 45 CSSStyleValueVector GetAllInternal(CSSPropertyID) override;
52 CSSStyleValueVector GetAllInternal( 46 CSSStyleValueVector GetAllInternal(
53 AtomicString custom_property_name) override; 47 AtomicString custom_property_name) override;
54 48
55 HeapVector<StylePropertyMapEntry> GetIterationEntries() override { 49 HeapVector<StylePropertyMapEntry> GetIterationEntries() override {
56 return HeapVector<StylePropertyMapEntry>(); 50 return HeapVector<StylePropertyMapEntry>();
57 } 51 }
58 52
59 Member<CSSComputedStyleDeclaration> computed_style_declaration_;
60 PseudoId pseudo_id_; 53 PseudoId pseudo_id_;
61 Member<Node> node_; 54 Member<Node> node_;
55
56 private:
57 Node* StyledNode() const;
58 const ComputedStyle* UpdateStyle() const;
62 }; 59 };
63 60
64 } // namespace blink 61 } // namespace blink
65 62
66 #endif 63 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698