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

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

Issue 2322343003: Add support for <basic-shape> to 'clip-path' on SVG elements (Closed)
Patch Set: Update SPv2 expectations Created 4 years, 3 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
OLDNEW
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/CSSPropertyParser.h" 5 #include "core/css/parser/CSSPropertyParser.h"
6 6
7 #include "core/StylePropertyShorthand.h" 7 #include "core/StylePropertyShorthand.h"
8 #include "core/css/CSSBasicShapeValues.h" 8 #include "core/css/CSSBasicShapeValues.h"
9 #include "core/css/CSSBorderImage.h" 9 #include "core/css/CSSBorderImage.h"
10 #include "core/css/CSSContentDistributionValue.h" 10 #include "core/css/CSSContentDistributionValue.h"
(...skipping 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after
2264 else if (id == CSSValuePolygon) 2264 else if (id == CSSValuePolygon)
2265 shape = consumeBasicShapePolygon(args, context); 2265 shape = consumeBasicShapePolygon(args, context);
2266 else if (id == CSSValueInset) 2266 else if (id == CSSValueInset)
2267 shape = consumeBasicShapeInset(args, context); 2267 shape = consumeBasicShapeInset(args, context);
2268 if (!shape || !args.atEnd()) 2268 if (!shape || !args.atEnd())
2269 return nullptr; 2269 return nullptr;
2270 range = rangeCopy; 2270 range = rangeCopy;
2271 return shape; 2271 return shape;
2272 } 2272 }
2273 2273
2274 static CSSValue* consumeWebkitClipPath(CSSParserTokenRange& range, const CSSPars erContext& context) 2274 static CSSValue* consumeClipPath(CSSParserTokenRange& range, const CSSParserCont ext& context)
2275 { 2275 {
2276 if (range.peek().id() == CSSValueNone) 2276 if (range.peek().id() == CSSValueNone)
2277 return consumeIdent(range); 2277 return consumeIdent(range);
2278 if (CSSURIValue* url = consumeUrl(range)) 2278 if (CSSURIValue* url = consumeUrl(range))
2279 return url; 2279 return url;
2280 return consumeBasicShape(range, context); 2280 return consumeBasicShape(range, context);
2281 } 2281 }
2282 2282
2283 static CSSValue* consumeShapeOutside(CSSParserTokenRange& range, const CSSParser Context& context) 2283 static CSSValue* consumeShapeOutside(CSSParserTokenRange& range, const CSSParser Context& context)
2284 { 2284 {
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
3351 case CSSPropertyWebkitTransformOriginZ: 3351 case CSSPropertyWebkitTransformOriginZ:
3352 return consumeLength(m_range, m_context.mode(), ValueRangeAll); 3352 return consumeLength(m_range, m_context.mode(), ValueRangeAll);
3353 case CSSPropertyFill: 3353 case CSSPropertyFill:
3354 case CSSPropertyStroke: 3354 case CSSPropertyStroke:
3355 return consumePaintStroke(m_range, m_context.mode()); 3355 return consumePaintStroke(m_range, m_context.mode());
3356 case CSSPropertyPaintOrder: 3356 case CSSPropertyPaintOrder:
3357 return consumePaintOrder(m_range); 3357 return consumePaintOrder(m_range);
3358 case CSSPropertyMarkerStart: 3358 case CSSPropertyMarkerStart:
3359 case CSSPropertyMarkerMid: 3359 case CSSPropertyMarkerMid:
3360 case CSSPropertyMarkerEnd: 3360 case CSSPropertyMarkerEnd:
3361 case CSSPropertyClipPath:
3362 case CSSPropertyMask: 3361 case CSSPropertyMask:
3363 return consumeNoneOrURI(m_range); 3362 return consumeNoneOrURI(m_range);
3364 case CSSPropertyFlexBasis: 3363 case CSSPropertyFlexBasis:
3365 return consumeFlexBasis(m_range, m_context.mode()); 3364 return consumeFlexBasis(m_range, m_context.mode());
3366 case CSSPropertyFlexGrow: 3365 case CSSPropertyFlexGrow:
3367 case CSSPropertyFlexShrink: 3366 case CSSPropertyFlexShrink:
3368 return consumeNumber(m_range, ValueRangeNonNegative); 3367 return consumeNumber(m_range, ValueRangeNonNegative);
3369 case CSSPropertyStrokeDasharray: 3368 case CSSPropertyStrokeDasharray:
3370 return consumeStrokeDasharray(m_range); 3369 return consumeStrokeDasharray(m_range);
3371 case CSSPropertyColumnRuleWidth: 3370 case CSSPropertyColumnRuleWidth:
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
3422 return consumeInteger(m_range); 3421 return consumeInteger(m_range);
3423 case CSSPropertyTextUnderlinePosition: 3422 case CSSPropertyTextUnderlinePosition:
3424 // auto | [ under || [ left | right ] ], but we only support auto | unde r for now 3423 // auto | [ under || [ left | right ] ], but we only support auto | unde r for now
3425 ASSERT(RuntimeEnabledFeatures::css3TextDecorationsEnabled()); 3424 ASSERT(RuntimeEnabledFeatures::css3TextDecorationsEnabled());
3426 return consumeIdent<CSSValueAuto, CSSValueUnder>(m_range); 3425 return consumeIdent<CSSValueAuto, CSSValueUnder>(m_range);
3427 case CSSPropertyVerticalAlign: 3426 case CSSPropertyVerticalAlign:
3428 return consumeVerticalAlign(m_range, m_context.mode()); 3427 return consumeVerticalAlign(m_range, m_context.mode());
3429 case CSSPropertyShapeOutside: 3428 case CSSPropertyShapeOutside:
3430 return consumeShapeOutside(m_range, m_context); 3429 return consumeShapeOutside(m_range, m_context);
3431 case CSSPropertyWebkitClipPath: 3430 case CSSPropertyWebkitClipPath:
3432 return consumeWebkitClipPath(m_range, m_context); 3431 case CSSPropertyClipPath:
3432 return consumeClipPath(m_range, m_context);
3433 case CSSPropertyJustifyContent: 3433 case CSSPropertyJustifyContent:
3434 case CSSPropertyAlignContent: 3434 case CSSPropertyAlignContent:
3435 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); 3435 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
3436 return consumeContentDistributionOverflowPosition(m_range); 3436 return consumeContentDistributionOverflowPosition(m_range);
3437 case CSSPropertyBorderImageRepeat: 3437 case CSSPropertyBorderImageRepeat:
3438 case CSSPropertyWebkitMaskBoxImageRepeat: 3438 case CSSPropertyWebkitMaskBoxImageRepeat:
3439 return consumeBorderImageRepeat(m_range); 3439 return consumeBorderImageRepeat(m_range);
3440 case CSSPropertyBorderImageSlice: 3440 case CSSPropertyBorderImageSlice:
3441 case CSSPropertyWebkitMaskBoxImageSlice: 3441 case CSSPropertyWebkitMaskBoxImageSlice:
3442 return consumeBorderImageSlice(property, m_range); 3442 return consumeBorderImageSlice(property, m_range);
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after
4716 case CSSPropertyGridTemplate: 4716 case CSSPropertyGridTemplate:
4717 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); 4717 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important);
4718 case CSSPropertyGrid: 4718 case CSSPropertyGrid:
4719 return consumeGridShorthand(important); 4719 return consumeGridShorthand(important);
4720 default: 4720 default:
4721 return false; 4721 return false;
4722 } 4722 }
4723 } 4723 }
4724 4724
4725 } // namespace blink 4725 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698