[csswg-drafts] [css-fonts-3] [css-fonts-4] getComputedStyle() and CSSStyleDeclaration of expanded shorthand

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

== [css-fonts-3] [css-fonts-4] getComputedStyle() and 
CSSStyleDeclaration of expanded shorthand ==
In CSS2.1, the `font` shorthand 
[accepted](https://www.w3.org/TR/CSS21/fonts.html#font-shorthand) 
values `normal` and `small-caps` for its `font-variant` constituent 
longhand.

In CSS Fonts level 3, `font-variant` was 
[expanded](https://drafts.csswg.org/css-fonts/#propdef-font-variant) 
to accept many new keywords. However, the `font` shorthand was [not 
similarly 
expanded](https://drafts.csswg.org/css-fonts/#font-variant-css21-values):
 It still only accepts `normal` and `small-caps`.

This forces us to ask the question, what is the value of:
```
<div id="test1" style="font: 16px Times; font-variant: 
historical-ligatures;">Hello World</div>
...
window.getComputedStyle(document.getElementById("test1")).getPropertyValue("font");
document.getElementById("test1").style.font;
```

This is also relevant to the variable fonts discussion: the 
`font-weight`, `font-stretch`, and `font-style` properties are part of
 the `font` shorthand, and are also becoming more expressive.

Currently, in WebKit, I'm proceeding as if the expanded values are 
equivalent to `normal` when constructing these strings. I'm not sure 
if this is the right way to go.

See also: https://github.com/w3c/csswg-drafts/issues/515

cc @fantasai @tabatkins 

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

Received on Saturday, 4 March 2017 00:58:11 UTC