Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp

Issue 2814453002: Add CSS conic-gradient calc() support (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSGradientValue.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSGradientValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698