Skip to content

[css-view-transitions-2] @view-transition resolution algorithm should cascade #9601

Open
@bokand

Description

@bokand

The @view-transition resolution algorithm is currently specifies:

To get the resolve @view-transition rule for a Document document:

  1. Let matchingRule be the last @view-transition rule in document which has a navigation descriptor whose computed value is auto.
  2. If matchingRule is not found, then return "not found".
  3. Return a list of strings corresponding to that descriptor’s computed value.

But I think it needs to account for the CSS cascade. Take this example:

<style>
  @view-transition {
    navigation: auto;
    type: foo;
  }

  @import url('style.css') layer(A);
</style>
  /*style.css*/
  @view-transition {
    navigation: auto;
    type: bar;
  }

I would expect the foo transition to be resolved, despite the fact that the bar transition is "last".

I think the way to do this will be to keep a map of all encountered @view-transition rules, keyed by their matcher descriptors (currently just navigation but later including from, to, etc. with succeeding levels of the cascade overriding a entries where the matchers are equal.


While we're here:

Return a list of strings corresponding to that descriptor’s computed value.

I'm assuming "that descriptor" is navigation?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions