Skip to content

[css-view-transitions-2] Timing for checking at-rule #9867

Closed
@khushalsagar

Description

@khushalsagar

The CSS opt-in which decides whether navigating away from a Document will trigger a transition is currently spec'd to be checked at 2 places:

  1. When the navigation is initiated. This is being landed in the html spec as a part of sourceSnapshotParams which are cached when the navigation starts: https://github.com/whatwg/html/pull/10002/files#r1464196273. We require it early in the navigation lifecycle for performance reasons.

  2. The second spot is here: https://drafts.csswg.org/css-view-transitions-2/#resolve-view-transition-rule-algo:~:text=Resolve%20%40view%2Dtransition%20rule%20for%20oldDocument%20and%20let%20resolvedRule%20be%20the%20result. This runs once we have the final response and before the old Document is unloaded.

I'm not sure doing it at step 2 is a good idea. It'll be racy since the task which runs these steps doesn't have an event which fires before the steps. So there's no way to reliably update the CSS. Also, we're providing an explicit event which has a VT object, the robust way would be to call skipTransition() on it. Having this check could encourage authors to opt-out via CSS after the navigation has been initiated instead of the more reliable event way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Monday morning

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions