Re: Splitting background-position in two different attributes

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 UTC