-
Notifications
You must be signed in to change notification settings - Fork 142
[css-typed-om] Calc representation not compatible with Custom Properties + var() #41
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
On Mon, Sep 14, 2015 at 8:55 AM, François REMY notifications@github.com wrote:
This is nothing to do with calc(). Any use of var() in a property
No, they don't need different OMs. Sometimes properties are just ~TJ |
Oooh, I see what you meant now. I see how this doesn't only apply on "calc(...)" which makes any "calc(...)"-specific fix moot. So, what we seem to agree on is something along the lines of a "special" value for things which cannot be represented as a parsed value yet, for instance if it includes "var" (either a string, or a token stream if we take a dependency on CSS Parser). I'm fine with this, is that what you proposed too? NOTE: We may have to think about "attr(...)" too. |
That's exactly what I said, so yes. ^_^
Good point. And toggle(), and any other functions which can represent simple types. |
For now these and other unsupported values are going to be represented by UnsupportedStyleValue objects. We'll get more sophisticated later. |
Actually we're going introduce a TokenStreamValue which will capture these. |
👍 |
Added in #169 |
The current proposal https://lists.w3.org/Archives/Public/public-houdini/2015Aug/0004.html cannot accurately represent things like:
I think the TypedOM proposal is stuck somewhere between the specified and the computed style. Both need a possibly different OM, even if converting from the latter one to the first one is trivial and should be natively supported by the API.
Under this proposal, the Computed.CalcPercentLength would only contain "px" and "percent", while the Specified.CalcPercentLength would contain something more abstract which can contains additions, products, etc... We could allow user agents to simplify those calculations to pixels and percentages when it is possible to do so without impacting the result (calc(3px + 3cm) could be memorized as calc(158px)).
Anyway, this needs further thought.
[EDIT] Another option would be to support only the ComputedValue Typed OM and have one extra value (
{value:string}
) which would be returned for specified styles which cannot accurately be converted to a value of the ComputedValue Typed OM. Or we could just disallow this entirely and mark the specified style write-only.The text was updated successfully, but these errors were encountered: