| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/CSSPropertyParserHelpers.h" | 5 #include "core/css/parser/CSSPropertyParserHelpers.h" |
| 6 | 6 |
| 7 #include "core/css/CSSCalculationValue.h" | 7 #include "core/css/CSSCalculationValue.h" |
| 8 #include "core/css/CSSColorValue.h" | 8 #include "core/css/CSSColorValue.h" |
| 9 #include "core/css/CSSCrossfadeValue.h" | 9 #include "core/css/CSSCrossfadeValue.h" |
| 10 #include "core/css/CSSGradientValue.h" | 10 #include "core/css/CSSGradientValue.h" |
| (...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 result->AddStop(stop); | 933 result->AddStop(stop); |
| 934 } | 934 } |
| 935 | 935 |
| 936 return result; | 936 return result; |
| 937 } | 937 } |
| 938 | 938 |
| 939 static CSSPrimitiveValue* ConsumeAngleOrPercent(CSSParserTokenRange& range, | 939 static CSSPrimitiveValue* ConsumeAngleOrPercent(CSSParserTokenRange& range, |
| 940 CSSParserMode, | 940 CSSParserMode, |
| 941 ValueRange value_range, | 941 ValueRange value_range, |
| 942 UnitlessQuirk) { | 942 UnitlessQuirk) { |
| 943 return range.Peek().GetType() == kPercentageToken | 943 if (auto* css_percent = ConsumePercent(range, value_range)) |
| 944 ? ConsumePercent(range, value_range) | 944 return css_percent; |
| 945 : ConsumeAngle(range); | 945 if (auto* css_angle = ConsumeAngle(range)) |
| 946 return css_angle; |
| 947 |
| 948 return nullptr; |
| 946 } | 949 } |
| 947 | 950 |
| 948 using PositionFunctor = CSSPrimitiveValue* (*)(CSSParserTokenRange&, | 951 using PositionFunctor = CSSPrimitiveValue* (*)(CSSParserTokenRange&, |
| 949 CSSParserMode, | 952 CSSParserMode, |
| 950 ValueRange, | 953 ValueRange, |
| 951 UnitlessQuirk); | 954 UnitlessQuirk); |
| 952 | 955 |
| 953 static bool ConsumeGradientColorStops(CSSParserTokenRange& range, | 956 static bool ConsumeGradientColorStops(CSSParserTokenRange& range, |
| 954 CSSParserMode css_parser_mode, | 957 CSSParserMode css_parser_mode, |
| 955 CSSGradientValue* gradient, | 958 CSSGradientValue* gradient, |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1426 | 1429 |
| 1427 // https://drafts.csswg.org/css-shapes-1/#typedef-shape-box | 1430 // https://drafts.csswg.org/css-shapes-1/#typedef-shape-box |
| 1428 CSSIdentifierValue* ConsumeShapeBox(CSSParserTokenRange& range) { | 1431 CSSIdentifierValue* ConsumeShapeBox(CSSParserTokenRange& range) { |
| 1429 return ConsumeIdent<CSSValueContentBox, CSSValuePaddingBox, CSSValueBorderBox, | 1432 return ConsumeIdent<CSSValueContentBox, CSSValuePaddingBox, CSSValueBorderBox, |
| 1430 CSSValueMarginBox>(range); | 1433 CSSValueMarginBox>(range); |
| 1431 } | 1434 } |
| 1432 | 1435 |
| 1433 } // namespace CSSPropertyParserHelpers | 1436 } // namespace CSSPropertyParserHelpers |
| 1434 | 1437 |
| 1435 } // namespace blink | 1438 } // namespace blink |
| OLD | NEW |