-
Notifications
You must be signed in to change notification settings - Fork 142
[css-properties-and-values] Setting/registering is allowed to be order-dependent #354
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
Further clarification: per Seattle resolution, when using a typed property in a stylesheet, setting to an invalid value doesn't trigger fallback. That is: <script>
CSS.registerProperty("--foo", {grammar: "<color>"});
</script>
<style>
div { --foo: red; }
div.foo { --foo: hello; }
</style> In here, the "--foo: hello" is not thrown out at parse-time; it's accepted, but because it's invalid, it gets treated as "--foo: unset;".
|
What specifically needs to change in Typed OM for this? Seems like mainly a properties & values thing? |
jyc
added a commit
to jyc/css-houdini-drafts
that referenced
this issue
Jul 19, 2017
…ntax-checked at computed-value time, not parse time. Clarify that the `syntax` field is used during computed-value time, write in the section about calculation of computed values that declarations can be found invalid at computed-value time, and update the example which previously indicated syntax-checking at parse time. Per Seattle resolution, as expressed in the following comments: > The original issue (should a property fail at parse-time if a typed > custom property is used in a wrong way, per the property's grammar) is, > I think, a no. I believe this falls out of our decision at the Seattle > f2f (w3c#354) that registering a custom property shouldn't require an > immediate global re-parse. You can do wrong things to/with a typed > custom property; it'll just cause a failure at computed-value time, like > an untyped custom property with an incompatible value does. > > - w3c#321 (comment) > Further clarification: per Seattle resolution, when using a typed > property in a stylesheet, setting to an invalid value doesn't trigger > fallback ... > > - w3c#354 (comment)
jyc
added a commit
to jyc/css-houdini-drafts
that referenced
this issue
Jul 19, 2017
…ntax-checked at computed-value time, not parse time. Clarify that the `syntax` field is used during computed-value time, write in the section about calculation of computed values that declarations can be found invalid at computed-value time, and update the example which previously indicated syntax-checking at parse time. Per Seattle resolution, as expressed in the following comments: > The original issue (should a property fail at parse-time if a typed > custom property is used in a wrong way, per the property's grammar) is, > I think, a no. I believe this falls out of our decision at the Seattle > f2f (w3c#354) that registering a custom property shouldn't require an > immediate global re-parse. You can do wrong things to/with a typed > custom property; it'll just cause a failure at computed-value time, like > an untyped custom property with an incompatible value does. > > - w3c#321 (comment) > Further clarification: per Seattle resolution, when using a typed > property in a stylesheet, setting to an invalid value doesn't trigger > fallback ... > > - w3c#354 (comment)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Per Seattle resolution (resolution is badly worded, read up to figure out what was actually being discussed), we're OK with an order-dependence between setting a value and registering a value.
That is, we want the following behavior:
and
The text was updated successfully, but these errors were encountered: