RE: [css3-backgrounds] Example XV inconsistent with prose of section 3.6

> From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
> Sent: Monday, September 13, 2010 6:23 PM
> To: Sylvain Galineau
> Cc: Brian Manthos; www-style@w3.org
> Subject: Re: [css3-backgrounds] Example XV inconsistent with prose of
> section 3.6
> 
> On Mon, Sep 13, 2010 at 6:15 PM, Sylvain Galineau
> <sylvaing@microsoft.com> wrote:
> >> From: www-style-request@w3.org [mailto:www-style-request@w3.org] On
> >> Behalf Of Tab Atkins Jr.
> >> Sent: Monday, September 13, 2010 4:59 PM
> >> To: Brian Manthos
> >> Cc: www-style@w3.org
> >> Subject: Re: [css3-backgrounds] Example XV inconsistent with prose
> of
> >> section 3.6
> >>
> >> On Mon, Sep 13, 2010 at 4:55 PM, Brian Manthos
> <brianman@microsoft.com>
> >> wrote:
> >> > From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
> >> >> On Mon, Sep 13, 2010 at 4:47 PM, Brian Manthos
> >> >> <brianman@microsoft.com> wrote:
> >> >>> http://dev.w3.org/csswg/css3-background/

> >> >>> 3.6  The ‘background-position’ property If only one value is
> >> >>> specified, the second value is assumed to be ‘center’.
> >> >>>
> >> >>> 3.10  The ‘background’ shorthand property p { background: 40%
> >> >>> url("chess.png") / 10em gray
> >> >>>        round fixed border-box; }
> >> >>> is equivalent to:
> >> >>> …
> >> >>> background-position: 40% 50%;
> >> >>> …
> >> >>>
> >> >>>
> >> >>> I believe this is incorrect.
> >> >>>
> >> >>> The equivalent is
> >> >>>         background-position: 40% center; or
> >> >>>         background-position: 40%;
> >> >>>
> >> >>>
> >> >>> Am I misunderstanding?
> >> >>
> >> >> 'center' and '50%' are equivalent in the context of a background-
> >> position.
> >> >
> >> > For rendering yes, for OM no...
> >>
> >> Ah, right.  Yeah, then that example is incorrect.
> >>
> > Why ? This module and its examples are not about the OM so I'm not
> clear on why
> > we can deem this example incorrect on OM grounds. But beyond that why
> is 50% not
> > equivalent to center in the OM ?
> 
> Well, it's not specified in any significant way, but it would be
> expected that saying "center" would make the current OM return
> "center", and saying "50%" would make the current OM return "50%".
> The Values API that Anne's been floating would differentiate between
> the two as well, claiming the type of the value to be "keyword" and
> "percentage" respectively.  (Like it allows you to differentiate
> between "red" and "#f00".)

I'm not sure what the 'current OM' is and where serialization is normatively
defined for specified/computed/etc values. I know Anne has drafted some of this 
in CSSOM but it remains, afaik, tentative and unreviewed by the WG. (Although
I have missed a f2f so correct me if I'm wrong...)

What the OM should return is, afaik, out of scope for this module. This is not an 
OM spec. It's not an OM serialization spec either.

Second, these are examples. Given that every single background-position keyword
is defined as equivalent to a percentage value I don't see what is wrong with 
using either for illustration purposes. Equivalent - to me - means you can use
either value anywhere you can set that property's value. No values in the 
equivalence set should succeed here and fail there.

Now, when reading the OM some people think one of the equivalent values should be 
the canonical one. Others think whatever the author specified is what's canonical. 
I'm afraid I can argue it either way; but the bigger prize is to spare authors the 
need to parse strings in the first place. Which brings us to Anne's work.

The Values API, afaik, is also something that needs review and implementation
experience. I don't feel comfortable saying an example completely unrelated to
the OM, it serialization and this new API is incorrect as in 'it needs to be 
edited'. It sounds like we're really saying the meaning of 'equivalent' in the
CSS3 Backgrounds & Borders module should be scoped/constrained in some manner. 

Frankly, I'd rather not have to define what 'equivalent' means at all. And leave
to relevant modules the job of defining what is and is not proper OM behavior.

Fwiw, Firefox 4 Beta 5 returns 50% for center. The spec says they're equivalent. 
I can't argue why that should be deemed 'incorrect'. 

Received on Tuesday, 14 September 2010 01:49:56 UTC