Re: [csswg-drafts] [css-view-transitions] Behavior of calling `document.startViewTransition` synchronously more than once (#11292)

> The Safari implementation is definitely wrong, as it violates the intent that [transitions are an enhancement](https://www.w3.org/TR/css-view-transitions-1/#transitions-as-enhancements).
> 
> > That means a failure to create a visual transition, which can happen due to misconfiguration or device constraints, will not prevent the developer’s [UpdateCallback](https://www.w3.org/TR/css-view-transitions-1/#callbackdef-updatecallback) being called, even if it’s known in advance that the transition animations cannot happen.
> > For example, if the developer calls [skipTransition()](https://www.w3.org/TR/css-view-transitions-1/#dom-viewtransition-skiptransition) at the start of the [view transition lifecycle](https://www.w3.org/TR/css-view-transitions-1/#lifecycle), the steps relating to the animated transition, such as creating the [view transition tree](https://www.w3.org/TR/css-view-transitions-1/#view-transition-tree), will not happen. However, the [UpdateCallback](https://www.w3.org/TR/css-view-transitions-1/#callbackdef-updatecallback) will still be called. It’s only the visual transition that’s skipped, not the underlying state change.

But Safari _is_ executing the first callback (the one that changes `.checked`) just fine. What is different between Chrome and Safari is that Safari seems to flush the queue of previously registered callbacks before taking the snapshots, whereas Chrome executes all previously registered callbacks as part of the resulting transition.

One could say Chrome is in the wrong here, because it changes the `.checked` state as part of the View Transition, which goes against _“It’s only the visual transition that’s skipped, not the underlying state change.”_ – Chrome does not skip the visual transition.



-- 
GitHub Notification of comment by bramus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11292#issuecomment-2514567080 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 3 December 2024 13:31:52 UTC