-
Notifications
You must be signed in to change notification settings - Fork 141
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
[css-typed-om] CSSTokenStreamValue #221
Comments
Thanks for your input! Renaming is already planned (see #193) and I'm therefore closing this issue on the behalf of the editors. To answer your question, it cannot be an array because it might need to be subclassed later when TypedOM supports more ranges of values than the L1 spec does at this point. |
Arrays can be subclassed... |
But they cannot subclass CSSValue, which any value would need to subclass ;-) |
This issue wasn't about the name, but about the representation. I'm re-opening this pending a decent resolution. |
So it needs to remain a CSSValue, not an Array. Iterable is already there, so it's array-like, it just needs to define indexed getters, which are tracked in #239. Closing this issue. |
Can someone state why it needs to subclass CSSValue? |
Sure, the reason is that the spec currently isn't complete. Level 1 will only support a subset of CSS Values. As we add more and more values in subsequent levels, things will have to change from being CSSUnparsedValue to being CSSXyzabcValue. While we are doing so, we cannot break behaviors that expected the old shape. If the old shape is an Array, we would need to keep it an array, which would prevent us from returning an actual CSSValue, which would be really weird. Authors should be able to expect any css value to be an instanceof CSSValue, not just the Level 1 ones. At least that is my understanding of it, anyone feel free to correct me. |
Stream seems too similar to https://streams.spec.whatwg.org/. Seems like the object represents a simple List... Any reason it can't just be an array?
The text was updated successfully, but these errors were encountered: