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

Side by Side Diff: third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.h

Issue 2366313006: CSS Properties and Values API: Support non-inherited custom properties (Closed)
Patch Set: use de morgan's law Created 4 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CSSVariableResolver_h 5 #ifndef CSSVariableResolver_h
6 #define CSSVariableResolver_h 6 #define CSSVariableResolver_h
7 7
8 #include "core/CSSPropertyNames.h" 8 #include "core/CSSPropertyNames.h"
9 #include "core/css/parser/CSSParserToken.h" 9 #include "core/css/parser/CSSParserToken.h"
10 #include "wtf/HashSet.h" 10 #include "wtf/HashSet.h"
11 #include "wtf/text/AtomicString.h" 11 #include "wtf/text/AtomicString.h"
12 #include "wtf/text/AtomicStringHash.h" 12 #include "wtf/text/AtomicStringHash.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class CSSParserTokenRange; 16 class CSSParserTokenRange;
17 class CSSPendingSubstitutionValue; 17 class CSSPendingSubstitutionValue;
18 class CSSVariableData; 18 class CSSVariableData;
19 class CSSVariableReferenceValue; 19 class CSSVariableReferenceValue;
20 class PropertyRegistry; 20 class PropertyRegistry;
21 class StyleResolverState; 21 class StyleResolverState;
22 class StyleVariableData; 22 class StyleInheritedVariables;
23 class StyleNonInheritedVariables;
23 24
24 class CSSVariableResolver { 25 class CSSVariableResolver {
25 STACK_ALLOCATED(); 26 STACK_ALLOCATED();
26 public: 27 public:
27 static void resolveVariableDefinitions(const StyleResolverState&); 28 static void resolveVariableDefinitions(const StyleResolverState&);
28 29
29 // Shorthand properties are not supported. 30 // Shorthand properties are not supported.
30 static const CSSValue* resolveVariableReferences(const StyleResolverState&, CSSPropertyID, const CSSValue&); 31 static const CSSValue* resolveVariableReferences(const StyleResolverState&, CSSPropertyID, const CSSValue&);
31 32
32 DECLARE_TRACE(); 33 DECLARE_TRACE();
(...skipping 16 matching lines...) Expand all
49 void resolveApplyAtRule(CSSParserTokenRange&, Vector<CSSParserToken>& result ); 50 void resolveApplyAtRule(CSSParserTokenRange&, Vector<CSSParserToken>& result );
50 51
51 // These return null if the custom property is invalid 52 // These return null if the custom property is invalid
52 53
53 // Returns the CSSVariableData for a custom property, resolving and storing it if necessary 54 // Returns the CSSVariableData for a custom property, resolving and storing it if necessary
54 CSSVariableData* valueForCustomProperty(AtomicString name); 55 CSSVariableData* valueForCustomProperty(AtomicString name);
55 // Resolves the CSSVariableData from a custom property declaration 56 // Resolves the CSSVariableData from a custom property declaration
56 PassRefPtr<CSSVariableData> resolveCustomProperty(AtomicString name, const C SSVariableData&); 57 PassRefPtr<CSSVariableData> resolveCustomProperty(AtomicString name, const C SSVariableData&);
57 58
58 const StyleResolverState& m_styleResolverState; 59 const StyleResolverState& m_styleResolverState;
59 StyleVariableData* m_styleVariableData; 60 StyleInheritedVariables* m_inheritedVariables;
61 StyleNonInheritedVariables* m_nonInheritedVariables;
60 Member<const PropertyRegistry> m_registry; 62 Member<const PropertyRegistry> m_registry;
61 HashSet<AtomicString> m_variablesSeen; 63 HashSet<AtomicString> m_variablesSeen;
62 // Resolution doesn't finish when a cycle is detected. Fallbacks still 64 // Resolution doesn't finish when a cycle is detected. Fallbacks still
63 // need to be tracked for additional cycles, and invalidation only 65 // need to be tracked for additional cycles, and invalidation only
64 // applies back to cycle starts. 66 // applies back to cycle starts.
65 HashSet<AtomicString> m_cycleStartPoints; 67 HashSet<AtomicString> m_cycleStartPoints;
66 }; 68 };
67 69
68 } // namespace blink 70 } // namespace blink
69 71
70 #endif // CSSVariableResolver 72 #endif // CSSVariableResolver
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698