Re: [css-houdini-drafts] CSSNumericArray should be an Array-like restricted to containing CSSNumericValue objects.

> Just to ensure I understand the issue: We would like 'values' to be an object that acts like an array but also has type checking to ensure every element is CSSNumericValue?

Yes. We have to do that type-checking at *some* point, and it's bad for both understandability and perf to do that at the point you actually try to set the value to some property.  (You can get at-time-of-mistake errors for every other sort of API, it's just arrays that don't allow it right now.)

The plan for now is to go with the "full Proxy" solution (indexed getters/setters), which gives us the `val[x]` syntax, and when WebIDL fixes this to give us cheaper numeric-property traps, switch the spec to that.

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

Received on Thursday, 19 October 2017 18:25:52 UTC