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: L. David Baron <dbaron@dbaron.org>
Date: Mon, 23 Jan 2012 11:39:30 -0800
To: Brian Manthos <brianman@microsoft.com>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, www-style list <www-style@w3.org>, fantasai <fantasai@inkedblade.net>
Message-ID: <20120123193930.GA5372@pickering.dbaron.org>
On Monday 2012-01-23 19:28 +0000, Brian Manthos 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

No, the computed value for background-position has both percentages
and lengths in it, just as it does today.  Percentages and lengths
in background-position have different meaning, and you can't convert
between them at the computed value level.  Computing equivalences
between them requires knowing the size of both the background
positioning area and the image.

> 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.

This is how background-position already behaves.

With any other approach, there would have to be differences in
behavior between some of the following:
  background-position: 75%
  background-position: calc(75%)
  background-position: calc(75% + 0px)
  background-position: calc(75% + 0.01px) /* other than the 0.01px offset */
or between analogous cases for lengths.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂
Received on Monday, 23 January 2012 19:40:00 GMT

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