-
Notifications
You must be signed in to change notification settings - Fork 142
[css-typed-om] Do CSSMathValue subclasses copy their constructor arguments? #494
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
Transcribing conversation with Tab. Q: are sum.values[0] and x the same object? |
Marking the second question as Needs-Feedback. |
I asked Shane and it looks like when you're mutating an expression tree, it should propagate type checking up. So setting |
The Working Group just discussed
The full IRC log of that discussion<nainar> Topic: Do CSSMathValue subclasses copy their constructor arguments?<TabAtkins> GitHub: https://github.com//issues/494 <nainar> TabAtkins: When I first drafted math classes they converted to new objects when read out. People didnt like that. <nainar> TabAtkins: Algo assumptions depended on getting fresh valudes that werent modifiable. So a px and a s would throw. But you can change the unit later. G9oes undetected until later. <nainar> TabAtkins: We cant do checks at mutation time. object moght be used in multiple places, where some might be fun but not all. <nainar> TabAtkins: So proposal is to restrict changing the type of MathVaues. Stay within category at least. <nainar> TabAtkins: Dont even think there is need to change within category. Happy to make type readonlhy <nainar> TabAtkins: Impact - cant change 5 px to 5 em by changing type. Do by constructing a new value. <nainar> TabAtkins: Minimal addition API weight for someone wanting to do this. (change px to em) <nainar> Rossen: You can easily wrap what you just said <nainar> TabAtkins: to method already does that <nainar> TabAtkins: Objections to changing type to read only? <dbaron> I'm generally happy with immutability. <nainar> RESOLVED: Change type to be immutable |
So the resolution doesn't solve this problem. It prevents you from changing the overall type of something if it's only composed of CSSUnitValues, but not if it's composed of CSSMathValues. That is, this is still allowed:
Calling So, I think we need to have a similar lock-down on setting |
Uh oh!
There was an error while loading. Please reload this page.
When you pass CSSNumericValues to construct a subclass of CSSMathValue, do the arguments get copied? For example,
I couldn't really find any wording for this; sorry if this was already implicit in the spec.
Spec: https://drafts.css-houdini.org/css-typed-om-1/#dom-cssmathsum-cssmathsum
The text was updated successfully, but these errors were encountered: