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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 24 Jun 2013 13:25:30 -0700
Message-ID: <CAAWBYDDffyQdb+WnQOdQ=rhVj0p1tmrmyXVJzoANs70nbOYWnQ@mail.gmail.com>
To: Rune Lillesveen <rune@opera.com>
Cc: www-style list <www-style@w3.org>
On Mon, Jun 24, 2013 at 5:17 AM, Rune Lillesveen <rune@opera.com> wrote:
> 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"?

After some thought, I think this one should be "initial", based on
current spec behavior.  We resolve all the global keywords at the same
time, during the transition from cascaded to specified values.
However, even the cascaded value is only meaningful with respect to a
given element; at the CSSStyleRule level, so at the point that the
above example asks for the value, "initial" should still be present.

I have no opinion on whether the previous example (where a property
was reset to its initial value by a shorthand) should return "initial"
or the initial value.

We *could* possibly change Cascade so that "initial" is resolved at
this stage, rather than waiting until specified-value time.  But I'm
not sure it's worth it.

~TJ
Received on Monday, 24 June 2013 20:26:16 UTC

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