-
Notifications
You must be signed in to change notification settings - Fork 745
[css-view-transitions-2] Add transition types #9385
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
Conversation
@khushalsagar @vmpstr ping? |
Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com>
Co-authored-by: Khushal Sagar <63884798+khushalsagar@users.noreply.github.com>
|
||
<div algorithm="start-vt-with-options"> | ||
The [=method steps=] for <dfn method for=Document>startViewTransition(|options|)</dfn> are as follows: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the comment above, these steps should also handle both situations by deferring to L1's algorithms as appropriate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Co-authored-by: vmpstr <vmpstr@chromium.org>
Co-authored-by: vmpstr <vmpstr@chromium.org>
css-view-transitions-2/Overview.bs
Outdated
|
||
partial interface Document { | ||
|
||
ViewTransition startViewTransition(optional (UpdateCallback or StartViewTransitionOptions)? callbackOrOptions = null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this IDL to say "callback or options"? L1 declares the API which only takes a callback : https://drafts.csswg.org/css-view-transitions-1/#additions-to-document-api. So if in L2 the IDL adds a new API which is
startViewTransition(StartViewTransitionOptions options = null);
Would that be equivalent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't have overloads like this in WebIDL (or in javascript, for that matter). The new method shadows the previous one in a way, but we make sure it's compatible.
Adding startViewTransition(StartViewTransitionOptions options = null)
would shadow the L1 function and not allow using a callback argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I was just playing around with the implementation and I think this is also not allowed due to the last point here:
https://webidl.spec.whatwg.org/#idl-nullable-type
The inner type must not be:
...
- a union type that itself includes a nullable type or has a dictionary type as one of its flattened member types.
I don't quite understand the non-normative justification for this rule, but I also think that we can just make the union non-nullable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically something like this might work
ViewTransition startViewTransition((UpdateCallback or StartViewTransitionOptions?) callbackOrOptionsOrNull);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % vmpstr.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
As per resolution at TPAC, adding a concept of "active types" to a view transition, with an
active-view-transition
pseudo-class that matches the root element if it has an active view transition that matches the list of active types.To set the active types,
startViewTransition
now accepts options, likestartViewTransition(update, types: ["slide", "reverse"]})
Closes #8960