| 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/parser/CSSVariableParser.h" | 5 #include "core/css/parser/CSSVariableParser.h" |
| 6 | 6 |
| 7 #include "core/css/CSSCustomPropertyDeclaration.h" | 7 #include "core/css/CSSCustomPropertyDeclaration.h" |
| 8 #include "core/css/parser/CSSParserTokenRange.h" | 8 #include "core/css/parser/CSSParserTokenRange.h" |
| 9 #include "core/css/parser/CSSParserValues.h" | 9 #include "core/css/parser/CSSParserValues.h" |
| 10 | 10 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 | 116 |
| 117 bool CSSVariableParser::containsValidVariableReferences(CSSParserTokenRange rang
e) | 117 bool CSSVariableParser::containsValidVariableReferences(CSSParserTokenRange rang
e) |
| 118 { | 118 { |
| 119 bool hasReferences; | 119 bool hasReferences; |
| 120 bool hasAtApplyRule; | 120 bool hasAtApplyRule; |
| 121 CSSValueID type = classifyVariableRange(range, hasReferences, hasAtApplyRule
); | 121 CSSValueID type = classifyVariableRange(range, hasReferences, hasAtApplyRule
); |
| 122 return type == CSSValueInternalVariableValue && hasReferences && !hasAtApply
Rule; | 122 return type == CSSValueInternalVariableValue && hasReferences && !hasAtApply
Rule; |
| 123 } | 123 } |
| 124 | 124 |
| 125 RawPtr<CSSCustomPropertyDeclaration> CSSVariableParser::parseDeclarationValue(co
nst AtomicString& variableName, CSSParserTokenRange range) | 125 CSSCustomPropertyDeclaration* CSSVariableParser::parseDeclarationValue(const Ato
micString& variableName, CSSParserTokenRange range) |
| 126 { | 126 { |
| 127 if (range.atEnd()) | 127 if (range.atEnd()) |
| 128 return nullptr; | 128 return nullptr; |
| 129 | 129 |
| 130 bool hasReferences; | 130 bool hasReferences; |
| 131 bool hasAtApplyRule; | 131 bool hasAtApplyRule; |
| 132 CSSValueID type = classifyVariableRange(range, hasReferences, hasAtApplyRule
); | 132 CSSValueID type = classifyVariableRange(range, hasReferences, hasAtApplyRule
); |
| 133 | 133 |
| 134 if (type == CSSValueInvalid) | 134 if (type == CSSValueInvalid) |
| 135 return nullptr; | 135 return nullptr; |
| 136 if (type == CSSValueInternalVariableValue) | 136 if (type == CSSValueInternalVariableValue) |
| 137 return CSSCustomPropertyDeclaration::create(variableName, CSSVariableDat
a::create(range, hasReferences || hasAtApplyRule)); | 137 return CSSCustomPropertyDeclaration::create(variableName, CSSVariableDat
a::create(range, hasReferences || hasAtApplyRule)); |
| 138 return CSSCustomPropertyDeclaration::create(variableName, type); | 138 return CSSCustomPropertyDeclaration::create(variableName, type); |
| 139 } | 139 } |
| 140 | 140 |
| 141 } // namespace blink | 141 } // namespace blink |
| OLD | NEW |