-
Notifications
You must be signed in to change notification settings - Fork 708
[css-syntax-3] Should a declaration value be consumed as a <declaration-value>
?
#11315
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
Comments
Chrome and FF (non-exhaustive) also do not accept a declaration value containing <style>
style {
color: !important var(--color);
}
</style>
<script>
document.styleSheets[0].cssRules[0].cssText; // style {}
</script>
This specific mismatch could be fixed generically in step 6, by saying that the next token should be a stop token or the stream should be empty. |
I realized that
So declaration values must not be restricted to As reported in #7987, these parse errors are not always explicit in the CSS Syntax algorithms, which is confusing. So I assume that bad tokens must be preserved in the token stream, and also in preludes and declaration values, except Alternatively, I guess a CSS parser can consume and validate each component value one after the other, which presumably requires making consume a function and consume a simple block context aware, so that |
In consume a declaration, it is currently consumed as a (unrestricted) list of component values.
But in the current version of Chrome and FF (at least), it seems to be consumed as a
<declaration-value>
:I could not say whether CSS2 also considered these declarations as invalid.
CSS Syntax 3 is less restrictive, which can change the declared value:
The text was updated successfully, but these errors were encountered: