W3C home > Mailing lists > Public > www-style@w3.org > January 2012

Re: [css3-2d-transforms][css3-images] <position> grammar is duplicated or points to the wrong spec

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 23 Jan 2012 11:38:26 -0800
Message-ID: <CAAWBYDDZVs=aTivZ-4b29eGoJjRN5tD5P6=SDCx7bBtxPF-sdQ@mail.gmail.com>
To: Brian Manthos <brianman@microsoft.com>
Cc: "L. David Baron" <dbaron@dbaron.org>, www-style list <www-style@w3.org>, fantasai <fantasai@inkedblade.net>
On Mon, Jan 23, 2012 at 11:28 AM, Brian Manthos <brianman@microsoft.com> wrote:
> I find this proposed behavior bizarre, personally.  I'm not sure I would fight against it yet (because I need to consider it some more), but on the surface it's very counterintuitive to me.
>
> For the example
>        Width: 200px;
>        Height: 400px;
>        Background-position: calc(100% - 5px) calc(100% - 10px);
>        Background-repeat: no-repeat;
>
> As I understand it, the computed value for background-position is something like
>        195px 390px
> with the upper left of the image at
>        (195px, 390px) from the upper-left origin
> as the Background specs currently stand.
>
> With the proposal below, a bunch of new confusing stuff pops out in both computed value and rendering.  Good luck with getting authors to have good results when inheriting values under such conditions.

Yes, that's a correct interpretation of the current spec behavior.

This is counter-intuitive given the traditional behavior of
percentages in bg-position, though.  It seems odd that
"background-position: 100% 100%" positions the image such that its
right and bottom edges are flush with the right and bottom edges of
the background area, but "background-position: calc(100% - 5px)
calc(100% - 5px)" positions the image such that its right and bottom
edges are way off beyond the right/bottom.  At minimum, you expect the
position of the image to shift by 5px in some direction, not several
hundred pixels.

~TJ
Received on Monday, 23 January 2012 19:39:14 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:48 GMT