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

[CSS3] background-position computed value.

From: Menard, Alexis <alexis.menard@intel.com>
Date: Wed, 28 Nov 2012 20:16:02 +0000
To: W3C style mailing list <www-style@w3.org>
CC: "jchaffraix@webkit.org" <jchaffraix@webkit.org>
Message-ID: <E5B147B05E7200468171AADBFC794D915701C0@FMSMSX107.amr.corp.intel.com>
Hi,

I'm a bit puzzled on the CSS3 computed style value for background-position.

In CSS 2.1 the computed value is defined as " for <length> the absolute value, otherwise a percentage". It will always return two values, so for example "left" will return 0% 50%, "30px 40px" will return 30px, 40px. FF, Opera, and WebKit behaves like this, always two values are returned, no keywords.

Now let's take the definition as in CSS3. "A list, each item consisting of: two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentage".

So of course something like left 20px top 40px should return "left 20px top 40px".

Now my question is what about the old behavior, let say background-position was set like this : 30px 40px. Should it return "30px 40px" as before or should it return "left 30px top 40px" to match the definition but then break the backward compatibility? I believe backward compatibility should be preserved and then the specification wording is not accurate as you may not get two keywords and two offsets every time.

As it is today Opera returns the old computed values, a list of two values and in the case of the new <position> type, the computed value as described by the CSS3 spec.

Any thoughts?

Thanks for the answer.
Received on Wednesday, 28 November 2012 20:16:32 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:03 GMT