Skip to content

[css-cascade-5] revert-layer in element-attached styles #10934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bramus opened this issue Sep 23, 2024 · 3 comments
Closed

[css-cascade-5] revert-layer in element-attached styles #10934

bramus opened this issue Sep 23, 2024 · 3 comments

Comments

@bramus
Copy link
Contributor

bramus commented Sep 23, 2024

As per https://drafts.csswg.org/css-cascade-5/#revert-layer, revert-layer in important element-attached styles should revert back to the author origin:

For revert-layer in important element-attached styles, however, it only reverts the element-attached styles and the intervening animation origin, and not any of the intervening author-origin important rules.

https://wpt.live/css/css-cascade/revert-layer-009.html however seems to imply this is also the case for regular element-attached styles, with all vendors agreeing on this behavior.

Suggestion to update the spec to the following, dropping the word “important”:

For revert-layer in element-attached styles, however, it only reverts the element-attached styles and the intervening animation origin, and not any of the intervening author-origin important rules.

@bramus
Copy link
Contributor Author

bramus commented Oct 1, 2024

/ping spec editors @fantasai @mirisuzanne @tabatkins

@mirisuzanne
Copy link
Contributor

mirisuzanne commented Oct 2, 2024

@bramus Both revert to styles within the author origin. That note is specifically about how to deal with intervening important rules. In the example you linked -- and always when the inline styles are not marked as important -- there are no intervening important rules:

- !important UA origin
- !important User origin
- !important Element attached (reverting from here…) ⏪
- !important Lowest Layer (…maintains these layers)
- !important Highest Layer (…)
- !important No Layer (…)
- Animation origin (…but would revert this one) ❌
- Element attached (…and this one. But the linked WP test starts here…) ❌
- No Layer (…and ends up here, which is also correct)
- Highest Layer
- Lowest Layer
- Presentation hints
- User origin
- UA origin

@bramus
Copy link
Contributor Author

bramus commented Oct 2, 2024

Very helpful comment. Thanks for clarifying.

@bramus bramus closed this as completed Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants