W3C home > Mailing lists > Public > www-style@w3.org > February 2014

Re: [css3-background] Inconsistencies in background shorthand examples

From: Stewart Brodie <sbrodie@espial.com>
Date: Mon, 10 Feb 2014 11:29:00 +0000
To: <www-style@w3.org>
Message-ID: <gemini.n0s2kc00d1j7v02i5.sbrodie@espial.com>
Brad Kemper <brad.kemper@gmail.com> wrote:

> 
> > On Feb 7, 2014, at 5:40 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
> > 
> >> On 07/02/2014 13:26, Stewart Brodie wrote:
> >> Example 18 shows multiple comma separated values for the background
> >> shorthand and describes the values assigned to each individual
sub-property,
> >> using this example:
> >> 
> >>     background: url(a.png) top left no-repeat,
> >>                 url(b.png) center / 100% 100% no-repeat,
> >>                 url(c.png) white;
> >> 
> >> It explains that for background-repeat, this means:
> >> 
> >>     background-repeat:     no-repeat, no-repeat no-repeat, repeat;
> >> 
> >> I think it should be:
> >> 
> >>     background-repeat:     no-repeat, no-repeat, repeat;
> >> 
> >> If not, then why not?
> > 
> > 
> > The example says "is equivalent to", which I think is technically
> > correct. "no-repeat no-repeat" and "no-repeat" are equivalent within one
> > comma-separated part.
> > 
> > However, I think this trick does not help the reader, and the example
> > would be better as you say it should be.

I agree that it says "is equivalent to".

However, I wasted quite a lot of time reading back through all the
descriptions of all the sub-properties, several times, looking for some tiny
detail in the explanations that might alter the behaviour of
background-repeat and thus why example 18 contained that inconsistency.


> Now that you mention it, I think it would be even more clear if examples
> 17 and 18 were more like example 15, and showed the computed values for
> background-repeat. That is, with horizontal and vertical pairs for each
> layer.

I don't agree.  The values in shorthands do not get expanded to the computed
values of the sub-properties anywhere else.

You aren't going to be able to tell what the UA has done anyway, because
when you ever ask it to serialize the value, it should be giving you the
shortest version, without this pointless duplication, so now you've still
got the observable behaviour inconsistent with the example in the
specification.

If you think that it is better to always expand to two values, you'd better
also change the initial value to "repeat repeat" as well, otherwise, when
the CSS parser goes through initialising all the sub-properties to their
initial values, you'll have another inconsistency.

I think it's far easier, quicker and clearer to just use the obvious
shortest expansion in the two lines in the examples.


-- 
Stewart Brodie
Senior Software Engineer
Team Leader ANT Galio Browser
Espial UK
Received on Monday, 10 February 2014 11:29:42 UTC

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