Skip to content

Commit

Permalink
[web-animations] remove animationShorthandForParsing()
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265571
rdar://118977751

Reviewed by Antti Koivisto.

There is a dedicated function called `animationShorthandForParsing()` to get the `animation` shorthand
list of longhands specifically for parsing purposes, but that list matches the similar function generated
from `CSSProperties.json` exactly, and so is redundant and should be removed.

* Source/WebCore/css/StylePropertyShorthand.cpp:
(WebCore::animationShorthandForParsing): Deleted.
* Source/WebCore/css/StylePropertyShorthand.h:
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseShorthand):

Canonical link: https://commits.webkit.org/271335@main
  • Loading branch information
graouts committed Nov 30, 2023
1 parent 6bc2bf1 commit 200b6e4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
18 changes: 0 additions & 18 deletions Source/WebCore/css/StylePropertyShorthand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,6 @@

namespace WebCore {

StylePropertyShorthand animationShorthandForParsing()
{
// Animation-name must come last, so that keywords for other properties in the shorthand
// preferentially match those properties.
static const CSSPropertyID animationPropertiesForParsing[] = {
CSSPropertyAnimationDuration,
CSSPropertyAnimationTimingFunction,
CSSPropertyAnimationDelay,
CSSPropertyAnimationIterationCount,
CSSPropertyAnimationDirection,
CSSPropertyAnimationFillMode,
CSSPropertyAnimationPlayState,
CSSPropertyAnimationName
};

return StylePropertyShorthand(CSSPropertyAnimation, animationPropertiesForParsing);
}

StylePropertyShorthand transitionShorthandForParsing()
{
// Similar to animations, we have property after timing-function and delay after
Expand Down
3 changes: 1 addition & 2 deletions Source/WebCore/css/StylePropertyShorthand.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ class StylePropertyShorthand {
CSSPropertyID m_shorthandID { CSSPropertyInvalid };
};

// Custom StylePropertyShorthand functions.
StylePropertyShorthand animationShorthandForParsing();
// Custom StylePropertyShorthand function.
StylePropertyShorthand transitionShorthandForParsing();

// Returns empty value if the property is not a shorthand.
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/css/parser/CSSPropertyParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2679,7 +2679,7 @@ bool CSSPropertyParser::parseShorthand(CSSPropertyID property, bool important)
case CSSPropertyColumns:
return consumeColumns(important);
case CSSPropertyAnimation:
return consumeAnimationShorthand(animationShorthandForParsing(), important);
return consumeAnimationShorthand(animationShorthand(), important);
case CSSPropertyTransition:
return consumeAnimationShorthand(transitionShorthandForParsing(), important);
case CSSPropertyTextDecoration: {
Expand Down

0 comments on commit 200b6e4

Please sign in to comment.