Skip to content

[web-animations-2] Add range offset APIs #8630

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

Merged
merged 2 commits into from
Apr 3, 2023

Conversation

fantasai
Copy link
Collaborator

@fantasai fantasai commented Mar 22, 2023

See #7589 and #7637.

@fantasai
Copy link
Collaborator Author

fantasai commented Mar 22, 2023

First question to @flackr: Did we decide to do #7589 (comment) ?

@flackr
Copy link
Contributor

flackr commented Mar 22, 2023

First question to @flackr: Did we decide to do #7589 (comment) ?

Yes, I think we're good with this. Note that this type will be for keyframe offsets. The delay and endDelay will remain as is (not referring to ranges) and we'll add rangeStart and rangeEnd to KeyframeAnimationOptions.

@flackr
Copy link
Contributor

flackr commented Mar 22, 2023

Yes, I think we're good with this. Note that this type will be for keyframe offsets. The delay and endDelay will remain as is (not referring to ranges) and we'll add rangeStart and rangeEnd to KeyframeAnimationOptions.

I'm somewhat confused by whether CSSNumericValue and TimelineRangeOffset are indeed distinguishable types. I think it may be okay as interface is distinguishable from interface as long as no platform object implements both right?

@tabatkins
Copy link
Member

TimelineRangeOffset is a dictionary, so it can't be "implemented by" anything, it's just a pattern used to destructure an input argument (or construct a plain JS object matching a pattern, for output). So that avoids the one possible case where an interface object like CSSNumericValue isn't distinguishable. And if you really meant CSSNumberish, the numeric types are also distinguishable from dictionaries so we're good.

@flackr
Copy link
Contributor

flackr commented Mar 23, 2023

Thanks for confirming @tabatkins. I had a feeling that most interface types were fancy destructuring but then I was worried CSSNumericValue might just be fancy destructuring too and create possible ambiguity.

@tabatkins
Copy link
Member

Interface types are specifically not fancy destructuring, those actually check that it's the correct object type - vended by the correct window object, even! Dictionary is just similar to sequence<> or record<> in that it's fancy destructuring.

@fantasai fantasai force-pushed the timeline-phase-API branch from fa126c5 to 1aa19df Compare March 24, 2023 21:54
@fantasai fantasai marked this pull request as ready for review March 24, 2023 22:30
@fantasai
Copy link
Collaborator Author

Alright, this is ready for review. :) I tried my best to guess what the right thing to do was for #7637 ; not sure if I got all the details right.

@fantasai fantasai requested review from birtles and flackr March 24, 2023 22:33
Comment on lines 3115 to 3116
The {{TimelineRangeOffset/rangeName}} and {{TimelineRangeOffset/offset}}
are the interpreted as defined for 'animation-range-end'.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow what this sentence means (or really this paragraph). What does interpreted mean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It means follow the definitions in https://drafts.csswg.org/scroll-animations-1/#animation-range-start for turning the rangeName and offset into a point on the timeline. I didn't want to inline those instructions, because they're changing as we adjust the syntax, defaulting rules, and capabilities of animation-range.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For better or worse this spec is pretty procedural, especially from "Programming interface" onwards, so that you can mostly just convert spec prose into implementation code. I'm just wondering what an implementer is supposed to do with "interpreted as".

From the point of view of this interface, as long as rangeName and rangeOffset get set to the right values, I think we're done. How those values are applied goes somewhere else (ideally somewhere in Web Animations which might then refer to definitions in scroll animations).

Copy link
Collaborator Author

@fantasai fantasai Mar 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How those values are applied goes somewhere else (ideally somewhere in Web Animations which might then refer to definitions in scroll animations).

Well, yeah, but that needs to be defined somewhere, and we don't have the conceptual infrastructure yet to reference it here. I can move the interpretation out of the definition here and put it in a separate paragraph, but I can't update Web Animations 2 to define the attachment range concepts without a significant amount of additional editing work in sections that have not yet been ported over.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, yeah, I think we should keep the description here just to how the value gets set. If we don't yet have anywhere to park the description of how those values are applied, we could add it here as a note of some sort indicating that it eventually needs to live somewhere else.

@fantasai fantasai force-pushed the timeline-phase-API branch from 2e2f6b5 to 3632602 Compare March 27, 2023 19:22
@xfq xfq added the web-animations-2 Current Work label Mar 28, 2023
@fantasai fantasai force-pushed the timeline-phase-API branch from 3632602 to b7f03e9 Compare March 29, 2023 21:58
@fantasai fantasai force-pushed the timeline-phase-API branch from b7f03e9 to 9f30c2e Compare April 1, 2023 03:35
@fantasai fantasai force-pushed the timeline-phase-API branch from 9f30c2e to 22bbd14 Compare April 3, 2023 22:27
@fantasai fantasai merged commit f724b31 into w3c:main Apr 3, 2023
@fantasai fantasai deleted the timeline-phase-API branch April 3, 2023 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web-animations-2 Current Work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants