| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 while (!range.atEnd()) { | 178 while (!range.atEnd()) { |
| 179 if (range.peek().functionId() == CSSValueVar) { | 179 if (range.peek().functionId() == CSSValueVar) { |
| 180 success &= resolveVariableReference(range.consumeBlock(), | 180 success &= resolveVariableReference(range.consumeBlock(), |
| 181 disallowAnimationTainted, result, | 181 disallowAnimationTainted, result, |
| 182 resultIsAnimationTainted); | 182 resultIsAnimationTainted); |
| 183 } else if (range.peek().type() == AtKeywordToken && | 183 } else if (range.peek().type() == AtKeywordToken && |
| 184 equalIgnoringASCIICase(range.peek().value(), "apply") && | 184 equalIgnoringASCIICase(range.peek().value(), "apply") && |
| 185 RuntimeEnabledFeatures::cssApplyAtRulesEnabled()) { | 185 RuntimeEnabledFeatures::cssApplyAtRulesEnabled()) { |
| 186 resolveApplyAtRule(range, result); | 186 resolveApplyAtRule(range, result); |
| 187 } else { | 187 } else { |
| 188 result.append(range.consume()); | 188 result.push_back(range.consume()); |
| 189 } | 189 } |
| 190 } | 190 } |
| 191 return success; | 191 return success; |
| 192 } | 192 } |
| 193 | 193 |
| 194 const CSSValue* CSSVariableResolver::resolveVariableReferences( | 194 const CSSValue* CSSVariableResolver::resolveVariableReferences( |
| 195 const StyleResolverState& state, | 195 const StyleResolverState& state, |
| 196 CSSPropertyID id, | 196 CSSPropertyID id, |
| 197 const CSSValue& value, | 197 const CSSValue& value, |
| 198 bool disallowAnimationTainted) { | 198 bool disallowAnimationTainted) { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 DEFINE_TRACE(CSSVariableResolver) { | 336 DEFINE_TRACE(CSSVariableResolver) { |
| 337 visitor->trace(m_registry); | 337 visitor->trace(m_registry); |
| 338 } | 338 } |
| 339 | 339 |
| 340 } // namespace blink | 340 } // namespace blink |
| OLD | NEW |