Re: [csswg-drafts] [css-view-transitions-1] Scope of the "user-agent origin" stylesheet (#8069)

I don't think that the current spec for the user-agent origin is meant to imply something specific about how-many default stylesheets are applied by the user-agent, or what their scope is - though I didn't write that section initially. As far as the cascade is concerned, I don't see any issue with user agents adding per-document dynamic styles in the user-agent origin. That seems like the right approach to me.

The transition and animation origins are not for declarations/at-rules _that describe_ a transition or animation - but for intermediate/iterpolated styles _caused by_ transitions and animations. So the following could be applied by a browser, as part of the user-agent origin:

```css
html::view-transition-old(*) {
 animation: -ua-view-transition-fade-out 0.25s both;
}
```

Authors would be able to override that from the author origin, if they want:

```css
html::view-transition-old(*) {
 animation: custom-fade-out 0.25s both;
}
```

First the `animation` declarations are compared by the cascade. They are coming from the user-agent and author origins. The author declaration will 'win' between those. Then the animation needs to actually run, and it will likely change/interpolate `opacity` from e.g. `1` to `0` along the way. Those interpolated values of `opacity` are applied from the animation origin, a higher cascade priority than all other normal origins, and lower than important origins.

Does that answer the question? Unless there's an issue from the implementation side, I would expect these generated rules to be 'user agent default styles' - and part of the user agent origin.

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


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

Received on Monday, 14 November 2022 17:24:38 UTC