[css-houdini-drafts] [css-typed-om] need to specify mappings between syntax, typed OM object tree, and underlying representation

dbaron has just created a new issue for https://github.com/w3c/css-houdini-drafts:

== [css-typed-om] need to specify mappings between syntax, typed OM object tree, and underlying representation ==
In order for the Typed OM to be interoperable, I believe that mappings need to be specified between:

* string representations of values (input to parsing and output from serializing)
* typed OM representations of values
* the underlying representation of the values

for both specified and computed values (except that some directions of the mapping don't need to be specified for computed values since they're readonly).  (CSS should also specify the mapping from the underlying representation of the specified value to the underlying representation of the computed value, but that's not Typed OM's problem.)

This information is property-specific, so it needs to be specified for all properties (although many properties will share rules).

It's also not clear to me if the Typed OM spec is intended that the typed OM object tree *is* the underlying representation.  There are certainly cases today where at least some browsers preserve distinctions that the Typed OM can't preserve, such as the `+` and `-` sign distinction in:

```js
let body = document.body;
body.style.width = "calc(30em + -2e1px)";
body.style.height = "calc(30em - 200e-1px)";
console.log(body.getAttribute("style"));
// Firefox: width: calc(30em - 20px); height: calc(30em - 20px);
// Chrome: width: calc(30em + -20px); height: calc(30em - 20px);
```

I don't think the information in [5.8. List of CSS properties to their CSSStyleValue reification
](https://drafts.css-houdini.org/css-typed-om-1/#reify-property-style-value) is anywhere near sufficient for this to be interoperable.

It would also be good if the spec were clear about whether its intent is that the Typed OM *is* the underlying representation; that would be important for reviewers of the specification.

Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/718 using your GitHub account

Received on Sunday, 25 February 2018 19:07:30 UTC