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

[scroll-animations-1] Ambiguous grammar of animation-range #9264

Open
cdoublev opened this issue Aug 29, 2023 · 2 comments
Open

[scroll-animations-1] Ambiguous grammar of animation-range #9264

cdoublev opened this issue Aug 29, 2023 · 2 comments
Labels

Comments

@cdoublev
Copy link
Collaborator

cdoublev commented Aug 29, 2023

https://drafts.csswg.org/scroll-animations-1/#animation-range

I assume animation-range: entry 10% should expand to animation-range-start: entry 10% and animation-range-end: normal (see next comment) animation-range-end: entry 100%.

But assuming the grammar can be symbolized with [a | b a?]{1,2} and the input is b a, I do not know which spec defines the matching behavior that says how many repetitions should match the input.

Maybe it should be clarified in prose (and the examples could include this case). For example:

If only a <timeline-range-name> and a <length-percentage> is specified, it is assumed to match <'animation-range-start'>, and <'animation-range-end'> is omitted.

Note this also means that when serializing animation-range, 0% cannot be omitted for the <timeline-range-name> of animation-range-start if animation-range-end is declared with a (single) <length-percentage>.

@cdoublev cdoublev added the scroll-animations-1 Current Work label Aug 29, 2023
@johannesodland
Copy link

I stumbled over the same issue and think it would be helpful to clarify this ambiguity in the spec.

I have one question regarding the expansion though @cdoublev:

If entry 10% is consumed by <'animation-range-start'>, shouldn't animation-range: entry 10% expand to animation-range-start: entry 10% and animation-range-end: entry 100% due to how animation-range-end is expanded when omitted?

If <'animation-range-end'> is omitted and <'animation-range-start'> includes a component, then animation-range-end is set to that same and 100%.

@cdoublev
Copy link
Collaborator Author

Oh yes, you are absolutely right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants