You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-view-transitions] Making the callback param non-nullable #9460
In #8960 we resolved to change the callback (in Level 2) to take either a callback or a dictionary of options. Naively, this would have been the following
ViewTransition startViewtransition(optional (UpdateCallback or Dictionary)? param = null)
I believe the only script visible change here is that this would preclude startViewTransition(null) from being valid. I could be wrong though. If I'm right, then I think that's fine, since that doesn't seem like a correct use of this API.
The CSS Working Group just discussed [css-view-transitions] Making the callback param non-nullable, and agreed to the following:
RESOLVED: Make the parameter non-nullable, but keep it optional
The full IRC log of that discussion
<emilio> noamr: we have a startViewTransition call that takes one param that is marked as optional nullable with default of null
<emilio> ... we resolved to extend this to allow a dictionary
<emilio> ... so naively it'd be an optional nullable union
<emilio> ... but that's not possible in WebIDL
<noamr> it's vmpstr, not noamr
<emilio> vmpstr: so proposal is making it non-nullable
<emilio> ... this only precludes null of being a valid parameter
<emilio> ... it'd still be optional
<emilio> astearns: if we decide on null as a naive way of dealing with the optionality?
<emilio> ... was there a purpose?
<emilio> vmpstr: there wasn't, it was just in the editor's draft since the beginning
<khush> +1
<emilio> q+
<khush> q+
<astearns> emilio: so if null is passed we will start throwing?
<astearns> ack emilio
<emilio> vmpstr: that's right
<emilio> emilio: hopefully nobody is doing that, if you're fine with the compat risk seems fine
<emilio> vmpstr: usage is low enough
<emilio> emilio: sounds good then
<emilio> khush: to add to vmpstr there's no production usecase where you'd do that
<emilio> ... because the callback is where you are supposed to mutate the DOM
<emilio> vmpstr: to clarify it's still optional, it'd be just explicit null that could be problematic
<emilio> RESOLVED: Make the parameter non-nullable, but keep it optional
Activity
css-meeting-bot commentedon Oct 18, 2023
The CSS Working Group just discussed
[css-view-transitions] Making the callback param non-nullable, and agreed to the following:RESOLVED: Make the parameter non-nullable, but keep it optionalThe full IRC log of that discussion
<emilio> noamr: we have a startViewTransition call that takes one param that is marked as optional nullable with default of null<emilio> ... we resolved to extend this to allow a dictionary
<emilio> ... so naively it'd be an optional nullable union
<emilio> ... but that's not possible in WebIDL
<noamr> it's vmpstr, not noamr
<emilio> vmpstr: so proposal is making it non-nullable
<emilio> ... this only precludes null of being a valid parameter
<emilio> ... it'd still be optional
<emilio> astearns: if we decide on null as a naive way of dealing with the optionality?
<emilio> ... was there a purpose?
<emilio> vmpstr: there wasn't, it was just in the editor's draft since the beginning
<khush> +1
<emilio> q+
<khush> q+
<astearns> emilio: so if null is passed we will start throwing?
<astearns> ack emilio
<emilio> vmpstr: that's right
<emilio> emilio: hopefully nobody is doing that, if you're fine with the compat risk seems fine
<emilio> vmpstr: usage is low enough
<emilio> emilio: sounds good then
<emilio> khush: to add to vmpstr there's no production usecase where you'd do that
<emilio> ... because the callback is where you are supposed to mutate the DOM
<emilio> vmpstr: to clarify it's still optional, it'd be just explicit null that could be problematic
<emilio> RESOLVED: Make the parameter non-nullable, but keep it optional
Fixes w3c#9460
Fixes #9460 (#9493)
VT: Make the startViewTransition parameter non-nullable.