OLD | NEW |
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 CSSVariableData_h | 5 #ifndef CSSVariableData_h |
6 #define CSSVariableData_h | 6 #define CSSVariableData_h |
7 | 7 |
8 #include "core/css/StylePropertySet.h" | 8 #include "core/css/StylePropertySet.h" |
9 #include "core/css/parser/CSSParserToken.h" | 9 #include "core/css/parser/CSSParserToken.h" |
10 #include "core/css/parser/CSSParserTokenRange.h" | 10 #include "core/css/parser/CSSParserTokenRange.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 bool needsVariableResolution() const { return m_needsVariableResolution; } | 44 bool needsVariableResolution() const { return m_needsVariableResolution; } |
45 | 45 |
46 const CSSValue* parseForSyntax(const CSSSyntaxDescriptor&) const; | 46 const CSSValue* parseForSyntax(const CSSSyntaxDescriptor&) const; |
47 | 47 |
48 StylePropertySet* propertySet(); | 48 StylePropertySet* propertySet(); |
49 | 49 |
50 private: | 50 private: |
51 CSSVariableData(const CSSParserTokenRange&, bool needsVariableResolution); | 51 CSSVariableData(const CSSParserTokenRange&, bool needsVariableResolution); |
52 | 52 |
53 // We can safely copy the tokens (which have raw pointers to substrings) becau
se | 53 // We can safely copy the tokens (which have raw pointers to substrings) |
54 // StylePropertySets contain references to CSSCustomPropertyDeclarations, whic
h | 54 // because StylePropertySets contain references to |
55 // point to the unresolved CSSVariableData values that own the backing strings | 55 // CSSCustomPropertyDeclarations, which point to the unresolved |
56 // this will potentially reference. | 56 // CSSVariableData values that own the backing strings this will potentially |
| 57 // reference. |
57 CSSVariableData(const Vector<CSSParserToken>& resolvedTokens, | 58 CSSVariableData(const Vector<CSSParserToken>& resolvedTokens, |
58 String backingString) | 59 String backingString) |
59 : m_backingString(backingString), | 60 : m_backingString(backingString), |
60 m_tokens(resolvedTokens), | 61 m_tokens(resolvedTokens), |
61 m_needsVariableResolution(false), | 62 m_needsVariableResolution(false), |
62 m_cachedPropertySet(false) {} | 63 m_cachedPropertySet(false) {} |
63 | 64 |
64 void consumeAndUpdateTokens(const CSSParserTokenRange&); | 65 void consumeAndUpdateTokens(const CSSParserTokenRange&); |
65 template <typename CharacterType> | 66 template <typename CharacterType> |
66 void updateTokens(const CSSParserTokenRange&); | 67 void updateTokens(const CSSParserTokenRange&); |
67 | 68 |
68 String m_backingString; | 69 String m_backingString; |
69 Vector<CSSParserToken> m_tokens; | 70 Vector<CSSParserToken> m_tokens; |
70 const bool m_needsVariableResolution; | 71 const bool m_needsVariableResolution; |
71 | 72 |
72 // Parsed representation for @apply | 73 // Parsed representation for @apply |
73 bool m_cachedPropertySet; | 74 bool m_cachedPropertySet; |
74 Persistent<StylePropertySet> m_propertySet; | 75 Persistent<StylePropertySet> m_propertySet; |
75 }; | 76 }; |
76 | 77 |
77 } // namespace blink | 78 } // namespace blink |
78 | 79 |
79 #endif // CSSVariableData_h | 80 #endif // CSSVariableData_h |
OLD | NEW |