Re: [csswg-drafts] [css-nesting] Another problem with mixing declarations and rules - error recovery (#8349)

> CSS has had forward compatible parsing and graceful degradation since day one. It's a core feature of the language.

Yes, but this can only go so far.
Which is why I referenced `@layer` specifically.

`@layer` in older browsers is just ignored, but there is no benefit to that.
The page will be broken anyway. There is no way to use `@layer` in a non-trivial way and have some form of compatibility with older browsers. For CSS authors and end users there is no difference between throwing out the entire stylesheet or only `@layer`. There will even be many cases where throwing out the entire stylesheet would have been better.

The same would be true for `@nest`.
The bit of CSS that is invalid and thrown out would be slightly different than nested CSS without `@nest` but the end result is a broken page all the same.

> but they will not (and should not) expect them to break other aspects of the stylesheet.

They should and do expect the rendered page to be fully broken.
There is just no way around this. The vast majority of rules and declarations will be nested and thus thrown out as invalid. The way nested CSS is written today is just not compatible with older browsers.

Exactly how it breaks at a tokenizer/parser level is something we care about, but CSS authors and end users do not.

> We can decide to just live with this (see option 3 above),

This seems fine to me.

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


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

Received on Monday, 23 January 2023 07:28:22 UTC