Re: [css3-background] background-shorthand and its background-clip side-effect

Tab Atkins Jr. wrote:
> On Fri, Mar 5, 2010 at 10:00 AM, Brad Kemper <brad.kemper@gmail.com> wrote:
>> On Mar 5, 2010, at 7:52 AM, Tab Atkins Jr. wrote:
>>
>>> On Thu, Mar 4, 2010 at 2:36 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
>>>> On it's own it not too bad, but as a way to disambiguate between two
>>>> subproperties in in 'background' that take the same values, it is
>>>> inconsistent with any of the proposals to disambiguate <bg-position> and
>>>> <bg-size>.  I don't think this serves authors as well, ultimately, who
>>>> currently have no expectations of how this disambiguation should occur.
>>> The position/size disambiguation needs to be more complex, because
>>> there is added possibility of confusion.  Both properties can have one
>>> or two value, so if you see two lengths next to each other, you can't
>>> tell whether it's just one property being specified or two being given
>>> a single value.  Similarly, if you see 3 values you can't tell which
>>> property gets a pair and which gets a singleton.
>> You can if you use the slash the way I was suggesting, which would also be consistent between disambiguating BOTH the <bg-position>/<bg-size> combinations AND the <bg-origin>/<bg-clip> combinations in the same ways. Thus, the position/size disambiguation does NOT need to be more complex than the origin/clip disambiguation. They can both be simple, with a single slash providing a reference point for disambiguation.
> 
> What I meant is that you don't *need* a slash in the origin/clip
> situation, since you can rely on a simple ordering.  That's not
> sufficient for position/size.  Ordering-based disambiguation is used
> much more commonly throughout CSS, and so should be relied on when
> possible.
> 
> ~TJ

I am very late to this debate. I proposed something way back in 2008 
which would have made <bg-position> / <bg-size> or just 
background-size not needed [1].


background-position: 0 0 auto auto; /* left top right bottom */
background-origin: content;


"And to clipped the top and left of the image at the content edge all 
you do is give the background-position-left and 
background-position-top negative values."


background-position: -100px -100px auto auto;
background-origin: content;


By keeping the current way of background-position [2] is a sure fire 
way for the CSS WG to paint themselves into a corner with no way to 
reverse it.

How are CSS author supposed to follow this spec that is depended on 
the order of values which are ambiguous? Just imagine an author 
encountering this.


background-position: left 10px top 15px;   /* 10px, 15px */
background-position: left      top     ;   /*  0px,  0px */
background-position:      10px     15px;   /* 10px, 15px */
background-position: left          15px;   /*  0px, 15px */
background-position:      10px top     ;   /* 10px,  0px */
background-position: left      top 15px;   /*  0px, 15px */
background-position: left 10px top     ;   /* 10px,  0px */


But that does not include <bg-size>, <bg-origin> or <bg-clip> [3] 
written in shorthand.


[1] <http://lists.w3.org/Archives/Public/www-style/2008May/0250.html>
[2] <http://dev.w3.org/csswg/css3-background/#the-background-position>
[3] <http://dev.w3.org/csswg/css3-background/#the-background>


-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo

Received on Sunday, 7 March 2010 08:23:08 UTC