| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/properties/CSSPropertyAPIFontVariationSettings.h" | 5 #include "core/css/properties/CSSPropertyAPIFontVariationSettings.h" |
| 6 | 6 |
| 7 #include "core/css/CSSFontVariationValue.h" | 7 #include "core/css/CSSFontVariationValue.h" |
| 8 #include "core/css/CSSValueList.h" | 8 #include "core/css/CSSValueList.h" |
| 9 #include "core/css/parser/CSSParserContext.h" | 9 #include "core/css/parser/CSSParserContext.h" |
| 10 #include "core/css/parser/CSSPropertyParserHelpers.h" | 10 #include "core/css/parser/CSSPropertyParserHelpers.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 double tagValue = 0; | 36 double tagValue = 0; |
| 37 if (!CSSPropertyParserHelpers::consumeNumberRaw(range, tagValue)) | 37 if (!CSSPropertyParserHelpers::consumeNumberRaw(range, tagValue)) |
| 38 return nullptr; | 38 return nullptr; |
| 39 return CSSFontVariationValue::create(tag, clampTo<float>(tagValue)); | 39 return CSSFontVariationValue::create(tag, clampTo<float>(tagValue)); |
| 40 } | 40 } |
| 41 | 41 |
| 42 } // namespace | 42 } // namespace |
| 43 | 43 |
| 44 const CSSValue* CSSPropertyAPIFontVariationSettings::parseSingleValue( | 44 const CSSValue* CSSPropertyAPIFontVariationSettings::parseSingleValue( |
| 45 CSSParserTokenRange& range, | 45 CSSParserTokenRange& range, |
| 46 const CSSParserContext& context) { | 46 const CSSParserContext* context) { |
| 47 DCHECK(RuntimeEnabledFeatures::cssVariableFontsEnabled()); | 47 DCHECK(RuntimeEnabledFeatures::cssVariableFontsEnabled()); |
| 48 if (range.peek().id() == CSSValueNormal) | 48 if (range.peek().id() == CSSValueNormal) |
| 49 return CSSPropertyParserHelpers::consumeIdent(range); | 49 return CSSPropertyParserHelpers::consumeIdent(range); |
| 50 CSSValueList* variationSettings = CSSValueList::createCommaSeparated(); | 50 CSSValueList* variationSettings = CSSValueList::createCommaSeparated(); |
| 51 do { | 51 do { |
| 52 CSSFontVariationValue* fontVariationValue = consumeFontVariationTag(range); | 52 CSSFontVariationValue* fontVariationValue = consumeFontVariationTag(range); |
| 53 if (!fontVariationValue) | 53 if (!fontVariationValue) |
| 54 return nullptr; | 54 return nullptr; |
| 55 variationSettings->append(*fontVariationValue); | 55 variationSettings->append(*fontVariationValue); |
| 56 } while (CSSPropertyParserHelpers::consumeCommaIncludingWhitespace(range)); | 56 } while (CSSPropertyParserHelpers::consumeCommaIncludingWhitespace(range)); |
| 57 return variationSettings; | 57 return variationSettings; |
| 58 } | 58 } |
| 59 | 59 |
| 60 } // namespace blink | 60 } // namespace blink |
| OLD | NEW |