[csswg-drafts] [cssom] Doubt about resolved value of shorthands

mrego has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [cssom] Doubt about resolved value of shorthands ==
Spec text: https://drafts.csswg.org/cssom/#resolved-value
> The resolved value for a given longhand property can be determined 
as follows:
> * A bunch of properties defining it.
> * A resolved value special case property defined in another 
specification.
>   As defined in the relevant specification.
> * Any other property.
>   The resolved value is the computed value.

The spec talks about **longhand** so I'm not sure what's the expected 
behavior for shorthands.

I've tried the following example for the [`flex` 
shorthand](https://drafts.csswg.org/css-flexbox/#flex-property):
```html
  <div style="display: flexbox;">
    <div id="flexitem" style="flex: 1;">item</div>
  </div>
  <script>
    console.log("flex: " + 
window.getComputedStyle(document.querySelector("#flexitem")).flex);
  </script>
```

The output in Chrome, Safari and Edge is:
```
  flex: 1 1 0%
```

However in Firefox it's:
```
  flex: 
```

In a [different 
issue](https://github.com/w3c/csswg-drafts/issues/1033#issuecomment-279706324)
 @upsuper commented:
> IIRC in general we don't serialize new shorthands in computed style,
 only longhands are serialized there. There are several shorthands get
 serialized in computed style just for backward compatibility.

What's the expected behavior?
Should the spec be updated to be clearer about the resolved value of 
shorthands?

Thanks! :smile: 

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

Received on Thursday, 16 February 2017 09:29:10 UTC