| 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 #include "core/css/resolver/CSSVariableResolver.h" | 5 #include "core/css/resolver/CSSVariableResolver.h" |
| 6 | 6 |
| 7 #include "core/CSSPropertyNames.h" | 7 #include "core/CSSPropertyNames.h" |
| 8 #include "core/CSSValueKeywords.h" | 8 #include "core/CSSValueKeywords.h" |
| 9 #include "core/StyleBuilderFunctions.h" | 9 #include "core/StyleBuilderFunctions.h" |
| 10 #include "core/StylePropertyShorthand.h" | 10 #include "core/StylePropertyShorthand.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 const CSSVariableData& variableData) { | 91 const CSSVariableData& variableData) { |
| 92 ASSERT(variableData.needsVariableResolution()); | 92 ASSERT(variableData.needsVariableResolution()); |
| 93 | 93 |
| 94 bool disallowAnimationTainted = false; | 94 bool disallowAnimationTainted = false; |
| 95 bool isAnimationTainted = variableData.isAnimationTainted(); | 95 bool isAnimationTainted = variableData.isAnimationTainted(); |
| 96 Vector<CSSParserToken> tokens; | 96 Vector<CSSParserToken> tokens; |
| 97 m_variablesSeen.insert(name); | 97 m_variablesSeen.insert(name); |
| 98 bool success = | 98 bool success = |
| 99 resolveTokenRange(variableData.tokens(), disallowAnimationTainted, tokens, | 99 resolveTokenRange(variableData.tokens(), disallowAnimationTainted, tokens, |
| 100 isAnimationTainted); | 100 isAnimationTainted); |
| 101 m_variablesSeen.remove(name); | 101 m_variablesSeen.erase(name); |
| 102 | 102 |
| 103 // The old variable data holds onto the backing string the new resolved | 103 // The old variable data holds onto the backing string the new resolved |
| 104 // CSSVariableData relies on. Ensure it will live beyond us overwriting the | 104 // CSSVariableData relies on. Ensure it will live beyond us overwriting the |
| 105 // RefPtr in StyleInheritedVariables. | 105 // RefPtr in StyleInheritedVariables. |
| 106 ASSERT(variableData.refCount() > 1); | 106 ASSERT(variableData.refCount() > 1); |
| 107 | 107 |
| 108 if (!success || !m_cycleStartPoints.isEmpty()) { | 108 if (!success || !m_cycleStartPoints.isEmpty()) { |
| 109 m_cycleStartPoints.remove(name); | 109 m_cycleStartPoints.erase(name); |
| 110 return nullptr; | 110 return nullptr; |
| 111 } | 111 } |
| 112 return CSSVariableData::createResolved(tokens, variableData, | 112 return CSSVariableData::createResolved(tokens, variableData, |
| 113 isAnimationTainted); | 113 isAnimationTainted); |
| 114 } | 114 } |
| 115 | 115 |
| 116 bool CSSVariableResolver::resolveVariableReference( | 116 bool CSSVariableResolver::resolveVariableReference( |
| 117 CSSParserTokenRange range, | 117 CSSParserTokenRange range, |
| 118 bool disallowAnimationTainted, | 118 bool disallowAnimationTainted, |
| 119 Vector<CSSParserToken>& result, | 119 Vector<CSSParserToken>& result, |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 } | 327 } |
| 328 } | 328 } |
| 329 } | 329 } |
| 330 | 330 |
| 331 CSSVariableResolver::CSSVariableResolver(const StyleResolverState& state) | 331 CSSVariableResolver::CSSVariableResolver(const StyleResolverState& state) |
| 332 : m_inheritedVariables(state.style()->inheritedVariables()), | 332 : m_inheritedVariables(state.style()->inheritedVariables()), |
| 333 m_nonInheritedVariables(state.style()->nonInheritedVariables()), | 333 m_nonInheritedVariables(state.style()->nonInheritedVariables()), |
| 334 m_registry(state.document().propertyRegistry()) {} | 334 m_registry(state.document().propertyRegistry()) {} |
| 335 | 335 |
| 336 } // namespace blink | 336 } // namespace blink |
| OLD | NEW |