Comments (7)
On Mon, Sep 14, 2015 at 8:55 AM, François REMY [email protected] wrote:
The current proposal https://lists.w3.org/Archives/Public/public-houdini/2015Aug/0004.html cannot accurately represent things like:
width: calc(var(--a) * var(--b));
--a: 3;
--b: 5px;
This is nothing to do with calc(). Any use of var() in a property
removes our ability to present that property in a typed OM until the
var() is resolved. Properties with an unresolved var() must instead
be presented as a simple token stream or string; this isn't yet
reflected in the draft.
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.
No, they don't need different OMs. Sometimes properties are just
represented differently based on the value computation phase you're
querying them from. For example, "width: calc(1px + 2em)" returns a
CalcLength for specified style, but a SimpleLength for computed style.
Nothing strange here.
~TJ
from css-houdini-drafts.
This is nothing to do with calc(). Any use of var() in a property
removes our ability to present that property in a typed OM until the
var() is resolved.
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.
from css-houdini-drafts.
I'm fine with this, is that what you proposed too?
That's exactly what I said, so yes. ^_^
NOTE: We may have to think about "attr(...)" too.
Good point. And toggle(), and any other functions which can represent simple types.
from css-houdini-drafts.
For now these and other unsupported values are going to be represented by UnsupportedStyleValue objects. We'll get more sophisticated later.
from css-houdini-drafts.
Actually we're going introduce a TokenStreamValue which will capture these.
from css-houdini-drafts.
👍
from css-houdini-drafts.
Added in #169
from css-houdini-drafts.
Related Issues (20)
- [css-typed-om] "Add two types" algorithm seems overly complicated? HOT 2
- [css-properties-values-api] Rule validity doesn't match implementations HOT 9
- [css-properties-values-api] JS API should use CSSOMString
- [css-typed-om] structuredClone for typed-om objects
- [css-properties-values-api] Add <string> as a supported syntax name HOT 3
- [css-properties-values-api] Clarify whether lengths using viewport units are "computationally independent"
- [css-typed-om] Add missing font units to CSSNumericFactory HOT 1
- [css-properties-values-api] Providing a way for @property to be opinionated about its usage
- [css-properties-values-api] Make `initial-value` descriptor optional
- [css-properties-values-api] `<transform-function>` interpolation between different function types
- [css-properties-values-api] Clarify parsing of duplicate descriptor declarations
- [css-properties-values-api-1] Multiple custom `@property` with the same name
- [css-properties-values-api-1] `CSSPropertyRule.initialValue` should not be nullable HOT 1
- [css-typed-om-1] Combining a number and the division of two dimensions of the same type HOT 2
- [scroll-customization-api] is there still interest/ongoing discussions for scroll customization? HOT 5
- [css-properties-values-api] `initial-value` for `*` with arbitrary substitution values HOT 1
- [css-typed-om-1] Broken references in CSS Typed OM Level 1 HOT 1
- [css-animation-worklet-1] how to enable CSS.animationWorklet
- [css-typed-om-1] Republish WD HOT 4
- [css-typed-om-1] `currentColor` is not the only non-absolute color HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from css-houdini-drafts.