Re: [csswg-drafts] [css-cascade] About omitted subproperty value in shorthand

> Oh I was not speaking about cssText serialization, but more that I 
like el.style.backgroundSize returning "initial" instead of "auto" 
because "auto" was never specified by the author; the property has its
 "initial| value instead, which happens to be auto.

As I mentioned before, making it returning `initial` instead of 
initial value like `auto` makes serialization code unnecessarily more 
complicated and error-prone, and it doesn't even work in many cases. 
For `background-size` particularly, what should `background: url(a) 
100%, url(b);` produce? `background-size: 100%, initial`? 
`background-size:`?

What would you expect from the following code to output?
```html
<!DOCTYPE html>
<div id="ref" style="background: url(#a), url(#b)"></div>
<div id="test"></div>
<script>
var ref = document.getElementById('ref');
var test = document.getElementById('test');
alert(ref.style.backgroundSize);
test.style.backgroundSize = ref.style.backgroundSize;
alert(test.style.backgroundSize);
</script>
```

-- 
GitHub Notification of comment by upsuper
Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/1068#issuecomment-284271833
 using your GitHub account

Received on Sunday, 5 March 2017 23:17:02 UTC