Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-animations] Negative time at start of animation shorthand #4034

Open
ewilligers opened this issue Jun 14, 2019 · 4 comments
Open

[css-animations] Negative time at start of animation shorthand #4034

ewilligers opened this issue Jun 14, 2019 · 4 comments
Labels
css-animations-1 Current Work

Comments

@ewilligers
Copy link
Contributor

https://drafts.csswg.org/css-animations/#animation

"the first value in each <single-animation> that can be parsed as a <time> is assigned to the animation-duration, and the second value in each <single-animation> that can be parsed as a <time> is assigned to animation-delay."

Negative <time> values are invalid for animation-duration.

Does this mean that if a negative <time> (like '-5s') appears at the start of animation, the shorthand value is invalid?

Spec (possible reading):
The negative value is rejected as it is only considered for animation-duration.
Reading the specified animation gives ''.
Reading computed animation gives values from style rules, or initial values.

Edge 18:
The negative value is accepted as animation-duration.
Reading the specified animation gives '-5s'.
Reading computed animation gives ''.

Safari:
The negative value is accepted as animation-delay.
Reading the specified animation gives '-5s'.
Reading computed animation gives ''.

Firefox:
The negative value is accepted as animation-delay.
Reading the specified animation gives '0s ease -5s 1 normal none running none'.
Reading computed animation gives ''.

Blink:
The negative value is accepted as animation-delay.
Reading the specified animation gives '0s ease -5s 1 normal none running none'.
Reading computed animation gives '0s ease -5s 1 normal none running none'.

https://jsfiddle.net/ericwilligers/eapsLyub/

@ewilligers ewilligers added the css-animations-1 Current Work label Jun 14, 2019
@ewilligers
Copy link
Contributor Author

This also affects transition.

the first value that can be parsed as a time is assigned to the transition-duration, and the second value that can be parsed as a time is assigned to transition-delay.

Negative <time> values are invalid for transition-duration.

Suppose the author specifies transition as '-5s'.

Spec (possible reading):
The negative value is rejected as it is only considered for transition-duration.
Reading the specified transition gives ''.
Reading computed transition gives values from style rules, or initial values.

Edge 18:
The negative value is accepted as transition-duration.
Reading the specified transition gives '-5s'.
Reading computed transition gives ''.

Safari:
The negative value is accepted as transition-delay.
Reading the specified transition gives '-5s'.
Reading computed transition gives 'all 0s ease -5s'.

Firefox:
The negative value is accepted as transition-delay.
Reading the specified transition gives 'all 0s ease -5s'.
Reading computed transition gives ''.

Blink:
The negative value is accepted as transition-delay.
Reading the specified transition gives 'all 0s ease -5s'.
Reading computed transition gives 'all 0s ease -5s'.

https://jsfiddle.net/ericwilligers/ho3jxw4r/

@birtles
Copy link
Contributor

birtles commented Aug 11, 2019

Firefox:
The negative value is accepted as transition-delay.
Reading the specified transition gives 'all 0s ease -5s'.
Reading computed transition gives ''.

Blink:
The negative value is accepted as transition-delay.
Reading the specified transition gives 'all 0s ease -5s'.
Reading computed transition gives 'all 0s ease -5s'.

I think the discrepancy there is just due to Firefox not returning shorthands from getComputedStyle right? (Bug 137688). i.e. for the purpose of this issue, I believe Gecko and Blink agree.

@ewilligers
Copy link
Contributor Author

for the purpose of this issue, I believe Gecko and Blink agree.

For the purpose of this issue, I believe Gecko and Blink and Safari agree: they all accept the leading negative time as animation-delay / transition-delay.

@ewilligers
Copy link
Contributor Author

We could have

Note that order is important within each animation definition: the first value in each single-animation that can be parsed as an animation-duration is assigned to animation-duration, and if a single-animation contains another value that can be parsed as a time, it is assigned to animation-delay.

This allows for cases like
calc((20px - 1em) / 1px * 1s) linear calc((1em - 20px) / 1px * 1s) anim
where, regardless of font-size, the first time value is animation-duration.

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Sep 24, 2019
… shorthand, a=testonly

Automatic update from web-platform-tests
[css-animations] [css-transitions] parse shorthand (#19195)

Parsing tests for animation and transition shorthands.
https://drafts.csswg.org/css-animations/#animation
https://drafts.csswg.org/css-transitions/#transition-shorthand-property

Open issues:
w3c/csswg-drafts#2031
w3c/csswg-drafts#4034
w3c/csswg-drafts#4223
--

wpt-commits: edffcf9ef316c6906591e734cea5bb42c8a60fdf
wpt-pr: 19195
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Sep 25, 2019
… shorthand, a=testonly

Automatic update from web-platform-tests
[css-animations] [css-transitions] parse shorthand (#19195)

Parsing tests for animation and transition shorthands.
https://drafts.csswg.org/css-animations/#animation
https://drafts.csswg.org/css-transitions/#transition-shorthand-property

Open issues:
w3c/csswg-drafts#2031
w3c/csswg-drafts#4034
w3c/csswg-drafts#4223
--

wpt-commits: edffcf9ef316c6906591e734cea5bb42c8a60fdf
wpt-pr: 19195
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 26, 2019
WPT for animation and transition shorthand computed values.

Open spec issues:
    w3c/csswg-drafts#2031
    w3c/csswg-drafts#4034
    w3c/csswg-drafts#4223

Change-Id: I3cac663f8a4cdce53856a9152e7b38033be9a76b
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 26, 2019
WPT for animation and transition shorthand computed values.

Open spec issues:
    w3c/csswg-drafts#2031
    w3c/csswg-drafts#4034
    w3c/csswg-drafts#4223

Change-Id: I3cac663f8a4cdce53856a9152e7b38033be9a76b
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 27, 2019
WPT for animation and transition shorthand computed values.

Open spec issues:
    w3c/csswg-drafts#2031
    w3c/csswg-drafts#4034
    w3c/csswg-drafts#4223

Change-Id: I3cac663f8a4cdce53856a9152e7b38033be9a76b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827317
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700825}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Sep 27, 2019
WPT for animation and transition shorthand computed values.

Open spec issues:
    w3c/csswg-drafts#2031
    w3c/csswg-drafts#4034
    w3c/csswg-drafts#4223

Change-Id: I3cac663f8a4cdce53856a9152e7b38033be9a76b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827317
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700825}
aarongable pushed a commit to chromium/chromium that referenced this issue Sep 27, 2019
WPT for animation and transition shorthand computed values.

Open spec issues:
    w3c/csswg-drafts#2031
    w3c/csswg-drafts#4034
    w3c/csswg-drafts#4223

Change-Id: I3cac663f8a4cdce53856a9152e7b38033be9a76b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827317
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700825}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 7, 2019
…nd transition, a=testonly

Automatic update from web-platform-tests
CSS: Test computed value for animation and transition

WPT for animation and transition shorthand computed values.

Open spec issues:
    w3c/csswg-drafts#2031
    w3c/csswg-drafts#4034
    w3c/csswg-drafts#4223

Change-Id: I3cac663f8a4cdce53856a9152e7b38033be9a76b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827317
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700825}

--

wpt-commits: 8530693c047e221fb2f55070082eb79620c56084
wpt-pr: 19320
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Oct 7, 2019
…nd transition, a=testonly

Automatic update from web-platform-tests
CSS: Test computed value for animation and transition

WPT for animation and transition shorthand computed values.

Open spec issues:
    w3c/csswg-drafts#2031
    w3c/csswg-drafts#4034
    w3c/csswg-drafts#4223

Change-Id: I3cac663f8a4cdce53856a9152e7b38033be9a76b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827317
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Reviewed-by: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700825}

--

wpt-commits: 8530693c047e221fb2f55070082eb79620c56084
wpt-pr: 19320
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 7, 2019
…nd transition, a=testonly

Automatic update from web-platform-tests
CSS: Test computed value for animation and transition

WPT for animation and transition shorthand computed values.

Open spec issues:
    w3c/csswg-drafts#2031
    w3c/csswg-drafts#4034
    w3c/csswg-drafts#4223

Change-Id: I3cac663f8a4cdce53856a9152e7b38033be9a76b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827317
Auto-Submit: Eric Willigers <ericwilligerschromium.org>
Commit-Queue: Stephen McGruer <smcgruerchromium.org>
Reviewed-by: Stephen McGruer <smcgruerchromium.org>
Cr-Commit-Position: refs/heads/master{#700825}

--

wpt-commits: 8530693c047e221fb2f55070082eb79620c56084
wpt-pr: 19320

UltraBlame original commit: c7015155594cd0b9aca8ec471c3ae4119fc62fec
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 7, 2019
…nd transition, a=testonly

Automatic update from web-platform-tests
CSS: Test computed value for animation and transition

WPT for animation and transition shorthand computed values.

Open spec issues:
    w3c/csswg-drafts#2031
    w3c/csswg-drafts#4034
    w3c/csswg-drafts#4223

Change-Id: I3cac663f8a4cdce53856a9152e7b38033be9a76b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827317
Auto-Submit: Eric Willigers <ericwilligerschromium.org>
Commit-Queue: Stephen McGruer <smcgruerchromium.org>
Reviewed-by: Stephen McGruer <smcgruerchromium.org>
Cr-Commit-Position: refs/heads/master{#700825}

--

wpt-commits: 8530693c047e221fb2f55070082eb79620c56084
wpt-pr: 19320

UltraBlame original commit: c7015155594cd0b9aca8ec471c3ae4119fc62fec
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 7, 2019
…nd transition, a=testonly

Automatic update from web-platform-tests
CSS: Test computed value for animation and transition

WPT for animation and transition shorthand computed values.

Open spec issues:
    w3c/csswg-drafts#2031
    w3c/csswg-drafts#4034
    w3c/csswg-drafts#4223

Change-Id: I3cac663f8a4cdce53856a9152e7b38033be9a76b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827317
Auto-Submit: Eric Willigers <ericwilligerschromium.org>
Commit-Queue: Stephen McGruer <smcgruerchromium.org>
Reviewed-by: Stephen McGruer <smcgruerchromium.org>
Cr-Commit-Position: refs/heads/master{#700825}

--

wpt-commits: 8530693c047e221fb2f55070082eb79620c56084
wpt-pr: 19320

UltraBlame original commit: c7015155594cd0b9aca8ec471c3ae4119fc62fec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-animations-1 Current Work
Projects
None yet
Development

No branches or pull requests

2 participants