| 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/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 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1431 if (args.atEnd() && parsedValue && | 1431 if (args.atEnd() && parsedValue && |
| 1432 (parsedValue->isCalculated() || parsedValue->getDoubleValue() > 0)) { | 1432 (parsedValue->isCalculated() || parsedValue->getDoubleValue() > 0)) { |
| 1433 CSSFunctionValue* result = CSSFunctionValue::create(CSSValueRepeat); | 1433 CSSFunctionValue* result = CSSFunctionValue::create(CSSValueRepeat); |
| 1434 result->append(*parsedValue); | 1434 result->append(*parsedValue); |
| 1435 return result; | 1435 return result; |
| 1436 } | 1436 } |
| 1437 } | 1437 } |
| 1438 return nullptr; | 1438 return nullptr; |
| 1439 } | 1439 } |
| 1440 | 1440 |
| 1441 static CSSValue* consumeClipPath(CSSParserTokenRange& range, | |
| 1442 const CSSParserContext* context) { | |
| 1443 if (range.peek().id() == CSSValueNone) | |
| 1444 return consumeIdent(range); | |
| 1445 if (CSSURIValue* url = consumeUrl(range, context)) | |
| 1446 return url; | |
| 1447 return CSSPropertyShapeUtils::consumeBasicShape(range, context); | |
| 1448 } | |
| 1449 | |
| 1450 static CSSValue* consumeContentDistributionOverflowPosition( | 1441 static CSSValue* consumeContentDistributionOverflowPosition( |
| 1451 CSSParserTokenRange& range) { | 1442 CSSParserTokenRange& range) { |
| 1452 if (identMatches<CSSValueNormal, CSSValueBaseline, CSSValueLastBaseline>( | 1443 if (identMatches<CSSValueNormal, CSSValueBaseline, CSSValueLastBaseline>( |
| 1453 range.peek().id())) | 1444 range.peek().id())) |
| 1454 return CSSContentDistributionValue::create( | 1445 return CSSContentDistributionValue::create( |
| 1455 CSSValueInvalid, range.consumeIncludingWhitespace().id(), | 1446 CSSValueInvalid, range.consumeIncludingWhitespace().id(), |
| 1456 CSSValueInvalid); | 1447 CSSValueInvalid); |
| 1457 | 1448 |
| 1458 CSSValueID distribution = CSSValueInvalid; | 1449 CSSValueID distribution = CSSValueInvalid; |
| 1459 CSSValueID position = CSSValueInvalid; | 1450 CSSValueID position = CSSValueInvalid; |
| (...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2566 case CSSPropertyBorderImageSource: | 2557 case CSSPropertyBorderImageSource: |
| 2567 case CSSPropertyWebkitMaskBoxImageSource: | 2558 case CSSPropertyWebkitMaskBoxImageSource: |
| 2568 return consumeImageOrNone(m_range, m_context); | 2559 return consumeImageOrNone(m_range, m_context); |
| 2569 case CSSPropertyPerspective: | 2560 case CSSPropertyPerspective: |
| 2570 return consumePerspective(m_range, m_context, unresolvedProperty); | 2561 return consumePerspective(m_range, m_context, unresolvedProperty); |
| 2571 case CSSPropertyScrollSnapPointsX: | 2562 case CSSPropertyScrollSnapPointsX: |
| 2572 case CSSPropertyScrollSnapPointsY: | 2563 case CSSPropertyScrollSnapPointsY: |
| 2573 return consumeScrollSnapPoints(m_range, m_context->mode()); | 2564 return consumeScrollSnapPoints(m_range, m_context->mode()); |
| 2574 case CSSPropertyOrder: | 2565 case CSSPropertyOrder: |
| 2575 return consumeInteger(m_range); | 2566 return consumeInteger(m_range); |
| 2576 case CSSPropertyClipPath: | |
| 2577 return consumeClipPath(m_range, m_context); | |
| 2578 case CSSPropertyJustifyContent: | 2567 case CSSPropertyJustifyContent: |
| 2579 case CSSPropertyAlignContent: | 2568 case CSSPropertyAlignContent: |
| 2580 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); | 2569 ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
| 2581 return consumeContentDistributionOverflowPosition(m_range); | 2570 return consumeContentDistributionOverflowPosition(m_range); |
| 2582 case CSSPropertyBorderImageRepeat: | 2571 case CSSPropertyBorderImageRepeat: |
| 2583 case CSSPropertyWebkitMaskBoxImageRepeat: | 2572 case CSSPropertyWebkitMaskBoxImageRepeat: |
| 2584 return consumeBorderImageRepeat(m_range); | 2573 return consumeBorderImageRepeat(m_range); |
| 2585 case CSSPropertyBorderImageSlice: | 2574 case CSSPropertyBorderImageSlice: |
| 2586 case CSSPropertyWebkitMaskBoxImageSlice: | 2575 case CSSPropertyWebkitMaskBoxImageSlice: |
| 2587 return consumeBorderImageSlice(property, m_range); | 2576 return consumeBorderImageSlice(property, m_range); |
| (...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4130 case CSSPropertyGridTemplate: | 4119 case CSSPropertyGridTemplate: |
| 4131 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); | 4120 return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important); |
| 4132 case CSSPropertyGrid: | 4121 case CSSPropertyGrid: |
| 4133 return consumeGridShorthand(important); | 4122 return consumeGridShorthand(important); |
| 4134 default: | 4123 default: |
| 4135 return false; | 4124 return false; |
| 4136 } | 4125 } |
| 4137 } | 4126 } |
| 4138 | 4127 |
| 4139 } // namespace blink | 4128 } // namespace blink |
| OLD | NEW |