-
Notifications
You must be signed in to change notification settings - Fork 757
Open
Labels
cssom-1Current WorkCurrent Work
Description
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:
<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 @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! 😄
Metadata
Metadata
Assignees
Labels
cssom-1Current WorkCurrent Work