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

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

Issue 2834433003: WIP CSSPropertyParserHelpers::ConsumeCommaSeparatedList template (Closed)
Patch Set: Removed extra isValidAnimationPropertyList checks Created 3 years, 7 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 | « no previous file | third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 case CSSPropertyWebkitLogicalHeight: 1683 case CSSPropertyWebkitLogicalHeight:
1684 return CSSPropertyLengthUtils::ConsumeWidthOrHeight(range_, *context_); 1684 return CSSPropertyLengthUtils::ConsumeWidthOrHeight(range_, *context_);
1685 case CSSPropertyScrollSnapDestination: 1685 case CSSPropertyScrollSnapDestination:
1686 case CSSPropertyObjectPosition: 1686 case CSSPropertyObjectPosition:
1687 case CSSPropertyPerspectiveOrigin: 1687 case CSSPropertyPerspectiveOrigin:
1688 return ConsumePosition(range_, context_->Mode(), UnitlessQuirk::kForbid); 1688 return ConsumePosition(range_, context_->Mode(), UnitlessQuirk::kForbid);
1689 case CSSPropertyWebkitHyphenateCharacter: 1689 case CSSPropertyWebkitHyphenateCharacter:
1690 case CSSPropertyWebkitLocale: 1690 case CSSPropertyWebkitLocale:
1691 return ConsumeLocale(range_); 1691 return ConsumeLocale(range_);
1692 case CSSPropertyAnimationDelay: 1692 case CSSPropertyAnimationDelay:
1693 case CSSPropertyTransitionDelay: 1693 case CSSPropertyTransitionDelay: {
1694 case CSSPropertyAnimationDirection: 1694 return CSSPropertyParserHelpers::ConsumeCommaSeparatedList(
1695 range_, CSSPropertyParserHelpers::ConsumeTime, kValueRangeAll);
1696 }
1697 case CSSPropertyAnimationDirection: {
1698 return CSSPropertyParserHelpers::ConsumeCommaSeparatedList(
1699 range_, CSSPropertyParserHelpers::ConsumeIdent<
1700 CSSValueNormal, CSSValueAlternate, CSSValueReverse,
1701 CSSValueAlternateReverse>);
1702 }
1695 case CSSPropertyAnimationDuration: 1703 case CSSPropertyAnimationDuration:
1696 case CSSPropertyTransitionDuration: 1704 case CSSPropertyTransitionDuration:
1697 case CSSPropertyAnimationFillMode: 1705 case CSSPropertyAnimationFillMode:
1698 case CSSPropertyAnimationIterationCount: 1706 return ConsumeAnimationPropertyList(
1707 property, range_, context_,
1708 unresolved_property == CSSPropertyAliasWebkitAnimationName);
1709 case CSSPropertyAnimationIterationCount: {
1710 return CSSPropertyParserHelpers::ConsumeCommaSeparatedList(
1711 range_, ConsumeAnimationIterationCount);
1712 }
1699 case CSSPropertyAnimationName: 1713 case CSSPropertyAnimationName:
1700 case CSSPropertyAnimationPlayState: 1714 case CSSPropertyAnimationPlayState:
1701 case CSSPropertyTransitionProperty: 1715 case CSSPropertyTransitionProperty:
1716 //TODO(bugsnash) check isValidAnimationPropertyList here
1702 case CSSPropertyAnimationTimingFunction: 1717 case CSSPropertyAnimationTimingFunction:
1703 case CSSPropertyTransitionTimingFunction: 1718 case CSSPropertyTransitionTimingFunction:
1719 // TODO(bugsnash): change this from default
1704 return ConsumeAnimationPropertyList( 1720 return ConsumeAnimationPropertyList(
1705 property, range_, context_, 1721 property, range_, context_,
1706 unresolved_property == CSSPropertyAliasWebkitAnimationName); 1722 unresolved_property == CSSPropertyAliasWebkitAnimationName);
1707 case CSSPropertyGridColumnGap: 1723 case CSSPropertyGridColumnGap:
1708 case CSSPropertyGridRowGap: 1724 case CSSPropertyGridRowGap:
1709 return ConsumeLengthOrPercent(range_, context_->Mode(), 1725 return ConsumeLengthOrPercent(range_, context_->Mode(),
1710 kValueRangeNonNegative); 1726 kValueRangeNonNegative);
1711 case CSSPropertyColor: 1727 case CSSPropertyColor:
1712 case CSSPropertyBackgroundColor: 1728 case CSSPropertyBackgroundColor:
1713 return ConsumeColor(range_, context_->Mode(), InQuirksMode()); 1729 return ConsumeColor(range_, context_->Mode(), InQuirksMode());
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after
3429 case CSSPropertyPlaceItems: 3445 case CSSPropertyPlaceItems:
3430 return ConsumePlaceItemsShorthand(important); 3446 return ConsumePlaceItemsShorthand(important);
3431 case CSSPropertyPlaceSelf: 3447 case CSSPropertyPlaceSelf:
3432 return ConsumePlaceSelfShorthand(important); 3448 return ConsumePlaceSelfShorthand(important);
3433 default: 3449 default:
3434 return false; 3450 return false;
3435 } 3451 }
3436 } 3452 }
3437 3453
3438 } // namespace blink 3454 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698