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 <memory> | 7 #include <memory> |
8 #include "core/StylePropertyShorthand.h" | 8 #include "core/StylePropertyShorthand.h" |
9 #include "core/css/CSSBasicShapeValues.h" | 9 #include "core/css/CSSBasicShapeValues.h" |
10 #include "core/css/CSSBorderImage.h" | 10 #include "core/css/CSSBorderImage.h" |
(...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1679 case CSSPropertyWebkitLogicalHeight: | 1679 case CSSPropertyWebkitLogicalHeight: |
1680 return CSSPropertyLengthUtils::ConsumeWidthOrHeight(range_, *context_); | 1680 return CSSPropertyLengthUtils::ConsumeWidthOrHeight(range_, *context_); |
1681 case CSSPropertyScrollSnapDestination: | 1681 case CSSPropertyScrollSnapDestination: |
1682 case CSSPropertyObjectPosition: | 1682 case CSSPropertyObjectPosition: |
1683 case CSSPropertyPerspectiveOrigin: | 1683 case CSSPropertyPerspectiveOrigin: |
1684 return ConsumePosition(range_, context_->Mode(), UnitlessQuirk::kForbid); | 1684 return ConsumePosition(range_, context_->Mode(), UnitlessQuirk::kForbid); |
1685 case CSSPropertyWebkitHyphenateCharacter: | 1685 case CSSPropertyWebkitHyphenateCharacter: |
1686 case CSSPropertyWebkitLocale: | 1686 case CSSPropertyWebkitLocale: |
1687 return ConsumeLocale(range_); | 1687 return ConsumeLocale(range_); |
1688 case CSSPropertyAnimationDelay: | 1688 case CSSPropertyAnimationDelay: |
1689 case CSSPropertyTransitionDelay: | 1689 case CSSPropertyTransitionDelay: { |
1690 case CSSPropertyAnimationDirection: | 1690 CSSValueList* list = CSSPropertyParserHelpers::ConsumeCommaSeparatedList( |
| 1691 range_, CSSPropertyParserHelpers::ConsumeTime, kValueRangeAll); |
| 1692 if (!IsValidAnimationPropertyList(property, *list)) |
| 1693 return nullptr; |
| 1694 return list; |
| 1695 } |
| 1696 case CSSPropertyAnimationDirection: { |
| 1697 CSSValueList* list = CSSPropertyParserHelpers::ConsumeCommaSeparatedList( |
| 1698 range_, CSSPropertyParserHelpers::ConsumeIdent< |
| 1699 CSSValueNormal, CSSValueAlternate, CSSValueReverse, |
| 1700 CSSValueAlternateReverse>); |
| 1701 if (!IsValidAnimationPropertyList(property, *list)) |
| 1702 return nullptr; |
| 1703 return list; |
| 1704 } |
1691 case CSSPropertyAnimationDuration: | 1705 case CSSPropertyAnimationDuration: |
1692 case CSSPropertyTransitionDuration: | 1706 case CSSPropertyTransitionDuration: |
1693 case CSSPropertyAnimationFillMode: | 1707 case CSSPropertyAnimationFillMode: |
1694 case CSSPropertyAnimationIterationCount: | 1708 return ConsumeAnimationPropertyList( |
| 1709 property, range_, context_, |
| 1710 unresolved_property == CSSPropertyAliasWebkitAnimationName); |
| 1711 case CSSPropertyAnimationIterationCount: { |
| 1712 CSSValueList* list = CSSPropertyParserHelpers::ConsumeCommaSeparatedList( |
| 1713 range_, ConsumeAnimationIterationCount); |
| 1714 if (!IsValidAnimationPropertyList(property, *list)) |
| 1715 return nullptr; |
| 1716 return list; |
| 1717 } |
1695 case CSSPropertyAnimationName: | 1718 case CSSPropertyAnimationName: |
1696 case CSSPropertyAnimationPlayState: | 1719 case CSSPropertyAnimationPlayState: |
1697 case CSSPropertyTransitionProperty: | 1720 case CSSPropertyTransitionProperty: |
1698 case CSSPropertyAnimationTimingFunction: | 1721 case CSSPropertyAnimationTimingFunction: |
1699 case CSSPropertyTransitionTimingFunction: | 1722 case CSSPropertyTransitionTimingFunction: |
| 1723 // TODO(bugsnash): change this from default |
1700 return ConsumeAnimationPropertyList( | 1724 return ConsumeAnimationPropertyList( |
1701 property, range_, context_, | 1725 property, range_, context_, |
1702 unresolved_property == CSSPropertyAliasWebkitAnimationName); | 1726 unresolved_property == CSSPropertyAliasWebkitAnimationName); |
1703 case CSSPropertyGridColumnGap: | 1727 case CSSPropertyGridColumnGap: |
1704 case CSSPropertyGridRowGap: | 1728 case CSSPropertyGridRowGap: |
1705 return ConsumeLengthOrPercent(range_, context_->Mode(), | 1729 return ConsumeLengthOrPercent(range_, context_->Mode(), |
1706 kValueRangeNonNegative); | 1730 kValueRangeNonNegative); |
1707 case CSSPropertyColor: | 1731 case CSSPropertyColor: |
1708 case CSSPropertyBackgroundColor: | 1732 case CSSPropertyBackgroundColor: |
1709 return ConsumeColor(range_, context_->Mode(), InQuirksMode()); | 1733 return ConsumeColor(range_, context_->Mode(), InQuirksMode()); |
(...skipping 1717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3427 case CSSPropertyPlaceItems: | 3451 case CSSPropertyPlaceItems: |
3428 return ConsumePlaceItemsShorthand(important); | 3452 return ConsumePlaceItemsShorthand(important); |
3429 case CSSPropertyPlaceSelf: | 3453 case CSSPropertyPlaceSelf: |
3430 return ConsumePlaceSelfShorthand(important); | 3454 return ConsumePlaceSelfShorthand(important); |
3431 default: | 3455 default: |
3432 return false; | 3456 return false; |
3433 } | 3457 } |
3434 } | 3458 } |
3435 | 3459 |
3436 } // namespace blink | 3460 } // namespace blink |
OLD | NEW |