OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CSSVariableResolver_h |
| 6 #define CSSVariableResolver_h |
| 7 |
| 8 #include "core/CSSPropertyNames.h" |
| 9 #include "core/css/parser/CSSParserToken.h" |
| 10 #include "wtf/HashSet.h" |
| 11 #include "wtf/text/AtomicString.h" |
| 12 #include "wtf/text/AtomicStringHash.h" |
| 13 |
| 14 namespace blink { |
| 15 |
| 16 class CSSPrimitiveValue; |
| 17 class StyleResolverState; |
| 18 class StyleVariableData; |
| 19 |
| 20 // TODO(leviw): Refactor to not just use static methods, and instead have privat
e members. |
| 21 class CSSVariableResolver { |
| 22 public: |
| 23 static void resolveVariableDefinitions(StyleResolverState&); |
| 24 static void resolveAndApplyVariableReferences(StyleResolverState&, CSSProper
tyID, CSSPrimitiveValue*); |
| 25 |
| 26 private: |
| 27 enum ResolutionBehavior { |
| 28 ResolvingVariableDefinitions, |
| 29 DoNotResolveVariableDefinitions |
| 30 }; |
| 31 |
| 32 CSSVariableResolver(const StyleVariableData*); |
| 33 CSSVariableResolver(const StyleVariableData*, AtomicString& variable); |
| 34 |
| 35 unsigned resolveVariableTokensRecursive(Vector<CSSParserToken>&, unsigned st
artOffset); |
| 36 void resolveVariableReferencesFromTokens(Vector<CSSParserToken>& tokens); |
| 37 |
| 38 const StyleVariableData* m_styleVariableData; |
| 39 HashSet<AtomicString> m_variablesSeen; |
| 40 bool m_cycleDetected; |
| 41 ResolutionBehavior m_resolutionBehavior; |
| 42 }; |
| 43 |
| 44 } // namespace blink |
| 45 |
| 46 #endif // CSSVariableResolver |
OLD | NEW |