W3C home > Mailing lists > Public > www-style@w3.org > June 2013

Re: [cssom][css3-values] Serialization of initial from shorthand

From: Rune Lillesveen <rune@opera.com>
Date: Mon, 24 Jun 2013 21:31:39 +0200
Message-ID: <51C89E9B.5090009@opera.com>
To: Glenn Adams <glenn@skynav.com>
CC: www-style list <www-style@w3.org>
On 06/24/2013 04:14 PM, Glenn Adams wrote:
> In the first case, I would expect "center" returned, and in the 
> second, I would expect "initial" returned: because these are specified 
> values.

In the first case, the background shorthand will reset 
background-position to its initial value, I just added the "center" 
declaration to illustrate that. So I think that needs to be either 
"initial" or "0% 0%". For the second case, I agree that it should be 
"initial". What I'm less sure about is the text from css-backgrounds:

"Given a valid declaration, for each layer the shorthand first sets the 
corresponding layer of each of 'background-image',..., and 
'background-attachment'to that property's initial value, ..."

Does it say "to that property's initial value" instead of "to 'initial'" 
because it's not aware of the 'initial' value from css-values?

> On Mon, Jun 24, 2013 at 9:17 PM, Rune Lillesveen <rune@opera.com 
> <mailto:rune@opera.com>> wrote:
>
>     When you serialize properties which have been set to its initial
>     value by a shorthand, and the UA supports the 'initial' keyword,
>     should the serialization use the 'initial' keyword or the actual
>     initial value?
>
>     Example:
>
>     <style>
>       p {
>         background-position: center;
>         background: blue;
>       }
>     </style>
>     <script>
>       alert(document.styleSheets[0].cssRules[0].style.backgroundPosition);
>     </script>
>
>     Output "0% 0%" or "initial"?
>
>
>     Also, is an explicit use of 'initial' different?:
>
>     <style>
>       p {
>         background-position: initial;
>       }
>     </style>
>     <script>
>       alert(document.styleSheets[0].cssRules[0].style.backgroundPosition);
>     </script>
>
>     Output "0% 0%" or "initial"?
>
Received on Monday, 24 June 2013 19:32:10 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:12 UTC