W3C home > Mailing lists > Public > www-style@w3.org > August 2011

Re: Splitting background-position in two different attributes

From: L. David Baron <dbaron@dbaron.org>
Date: Mon, 15 Aug 2011 12:41:53 -0700
To: Brian Manthos <brianman@microsoft.com>
Cc: fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <20110815194153.GA1077@pickering.dbaron.org>
On Monday 2011-08-15 19:21 +0000, Brian Manthos wrote:
> There are other concerns before you even get to that.
> 
> Things like...
> 
> div {
> 	background-image: url(a.png), url(b.png), url(c.png), url(d.png);
> 	background-position-x: 1px, 2px, 3px;
> 	background-position-y: 10%, 20%, 30%, 40%, 50%;
> 	background-repeat: no-repeat, repeat, repeat-y;
> }
> 
> (a) What should an OM query for background-position return?  (I
> think empty string because it's not constructible.)

I agree that querying specified style (e.g.,
element.style.getPropertyValue("background-position") or
sheet.cssRules[0].style.getPropertyValue("background-position"))
should return the empty string.

I tend to think
getComputedStyle(...).getPropertyValue("background-position") should
either return the empty string (which would match Gecko's current
behavior of propagating the lengths of the lists into computed
style) or it should return "1px 10%, 2px 20%, 3px 30%, 1px 40%"
which matches the length of the background-image list (which is what
affects the actual number of layers).

> (b) What should the used value for the x dimension of
> background-position be for the 4th image? (I think 1px, just like
> its repeat value is no-repeat.)

Definitely.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla Corporation               http://www.mozilla.com/   𝄂
Received on Monday, 15 August 2011 19:42:31 GMT

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