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

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