Skip to content
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

Closed
annevk opened this issue Jun 15, 2016 · 7 comments
Closed

[css-typed-om] CSSTokenStreamValue #221

annevk opened this issue Jun 15, 2016 · 7 comments

Comments

@annevk
Copy link
Member

annevk commented Jun 15, 2016

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?

@annevk annevk changed the title Rename CSSTokenStreamValue CSSTokenStreamValue Jun 15, 2016
@FremyCompany
Copy link
Contributor

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.

@annevk
Copy link
Member Author

annevk commented Jun 15, 2016

Arrays can be subclassed...

@FremyCompany
Copy link
Contributor

But they cannot subclass CSSValue, which any value would need to subclass ;-)

@shans shans reopened this Jun 24, 2016
@shans
Copy link
Contributor

shans commented Jun 24, 2016

This issue wasn't about the name, but about the representation. I'm re-opening this pending a decent resolution.

@shans shans changed the title CSSTokenStreamValue [css-typed-om] CSSTokenStreamValue Jun 24, 2016
@tabatkins
Copy link
Member

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.

@domenic
Copy link
Contributor

domenic commented Aug 12, 2016

Can someone state why it needs to subclass CSSValue?

@FremyCompany
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants