Skip to content

Fix longhands of the animation and transition shorthands - #284

Open
eXpl0it3r wants to merge 1 commit into
masterfrom
fix/animation-transition-shorthands
Open

eXpl0it3r wants to merge 1 commit into
masterfrom
fix/animation-transition-shorthands

Conversation

@eXpl0it3r

Copy link
Copy Markdown
Collaborator

The animation and transition shorthands expanded into the wrong longhands. With animation: slide 1s, the 1s ended up in animation-duration and animation-delay, and animation-name was reset to initial. As soon as a value had two times, e.g. transition: 1s 2s or animation: slide 1s ease-in 2s infinite alternate both paused, every longhand fell back to initial. transition: none was rejected as a whole.

TimeBasedShorthandConverter consumed the time values with the plain TimeConverter instead of the slot's converter, so the value wasn't bound to its longhand and got handed to every longhand of the shorthand. The time is now consumed through the converter of its slot, so the first time goes to the duration and the second one to the delay, and the other components keep their value. Additionally, the transition shorthand accepts none as property, but only if the list has a single item, as css-transitions-1 says.

How to test this PR?

CI should succeed. The following tests cover the expansion and fail on master:

  • AnimationShorthandSetsEveryLonghand
  • AnimationShorthandWithOneTimeSetsOnlyTheDuration
  • AnimationShorthandGivesKeywordsToTheOtherLonghandsFirst
  • AnimationShorthandListSetsTheLonghandsPerItem
  • CssTransitionShorthandWithOneTimeSetsOnlyTheDuration
  • CssTransitionShorthandAssignsTheSecondTimeToTheDelay
  • CssTransitionShorthandNoneSetsThePropertyToNone

CssTransitionShorthandWithNoneInAListIsInvalid makes sure transition: none, color 1s stays invalid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant