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

> if it's possible for an invalid rule to be considered as a declaration then it could trigger declaration error recovery, which will also swallow all the following nested rules.

Right, that's part of why I prefer the current spec's behavior wrt #8251 right now; by tilting toward parsing anything unknown as a rule, you get safer error recovery.

The proposed infinite lookahead algo (<https://github.com/w3c/csswg-drafts/issues/7961#issuecomment-1396112293>) also leans in this direction.  Of the three ways to trigger property parsing, the first ("starts with a dashed-ident") is "unsafe" but not a realistic confused-for-selector scenario; the second ("starts with `prop:...`") is safe bc it uses lookahead to know if it's gonna need to parse as a rule or property; the third ("starts with `prop: ...` (note the space)") is "unsafe" but again can only show up if you really screw up writing your selector.

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


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

Received on Friday, 27 January 2023 00:07:02 UTC