Re: [csswg-drafts] [css-view-transitions-2] Timing for checking at-rule (#9867)

The CSS Working Group just discussed `[css-view-transitions-2] Timing for checking at-rule`, and agreed to the following:

* `RESOLVED: check the at-rule a second time, when the nav is about to commit`

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> noamr: into cross-document VTs!<br>
&lt;TabAtkins> noamr: We have @view-transition rule, when it's read we understand the coming navigation should have a VT<br>
&lt;TabAtkins> noamr: right now, the way it's implemented you can say it's read in two places, or in one place<br>
&lt;TabAtkins> noamr: We read it once when the navigation starts<br>
&lt;TabAtkins> noamr: Because if there is no VT going on, we optimize and don't block the old document on anything<br>
&lt;TabAtkins> noamr: we want the nav to go asap<br>
&lt;TabAtkins> noamr: And then, if the at-rule is there, we block the old document, fire an event, etc. capture the documetn state<br>
&lt;TabAtkins> noamr: So what happens between the first check and the second check, if the VT rule changed. JS changed it, it's an MQ that changes etc<br>
&lt;TabAtkins> noamr: Two options. First is use the value at the beginning as the source of truth - animation is already starting<br>
&lt;TabAtkins> noamr: Second is to check again, skip the transition if it's changed to turn off the VT at this point.<br>
&lt;TabAtkins> noamr: Note that at second point we can't *start* a VT if it started false and then became true.<br>
&lt;bramus> TabAtkins: what is the 2nd time?<br>
&lt;TabAtkins> noamr: Right before we fire the pageswap event, we fire it so you can skip the transition. also this i sjust before we capture the snapshots<br>
&lt;TabAtkins> fantasai: between the two check times, is the doc live?<br>
&lt;TabAtkins> noamr: yes<br>
&lt;khush> q+<br>
&lt;miriam> ack fantasai<br>
&lt;TabAtkins> khush: first is when nav is initiated, then while we're waiting for the network response users can still interact with the doc. that's by design<br>
&lt;TabAtkins> noamr: Yeah it can be on the order of several seconds<br>
&lt;miriam> ack khush<br>
&lt;TabAtkins> khush: wanted to mention, the first check has a subtle reason for timing<br>
&lt;TabAtkins> khush: ideal would be to wait for network response and check at that time what the page wants<br>
&lt;TabAtkins> khush: but this is mainly for browser-generated navigations<br>
&lt;TabAtkins> khush: we dont' want to go back and dispatch an event late<br>
&lt;TabAtkins> khush: so now when a nav is started fro mteh browser process we just check immediately<br>
&lt;bkardell_> s/fro mteh/from the<br>
&lt;TabAtkins> khush: I also wanted us to just check once, when initiatied. second spot is a bit racy, unclear when the check happens<br>
&lt;TabAtkins> khush: But good point on MQs, if you're using that do decide animation<br>
&lt;TabAtkins> khush: It's nicer for that to apply if it can, rather than ignoring it and forcing you to do all the conditionality in script<br>
&lt;miriam> q?<br>
&lt;TabAtkins> noamr: So I'd like to propose that we check it twice - I think there's no real downside<br>
&lt;TabAtkins> noamr: It keeps you more correct on what happens to your at-rule. We're already queueing a task to block the doc, might as well check it again.<br>
&lt;miriam> ack fantasai<br>
&lt;TabAtkins> fantasai: I think changes in things like prefers-reduced-motion are so unlikely to not matter<br>
&lt;TabAtkins> fantasai: But MQs against screen size to change the *type* of animation you trigger, that seems mor elikely<br>
&lt;TabAtkins> fantasai: slide vs fade or something<br>
&lt;florian> +1 to fantasai's point<br>
&lt;TabAtkins> fantasai: so it does make sense to re-check. you're still triggering *a* transition, just not sure which type<br>
&lt;khush> +1<br>
&lt;TabAtkins> bramus: typical example would be user  rotating their phone from landscape to portrait<br>
&lt;fantasai> s/elikely/likely/<br>
&lt;TabAtkins> noamr: Proposed resolution: check the at-rule a second time, when you're ready to start the transition<br>
&lt;TabAtkins> RESOLVED: check the at-rule a second time, when the nav is about to commit<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9867#issuecomment-1939302384 using your GitHub account


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

Received on Monday, 12 February 2024 18:27:25 UTC