RE: [css3-background] background-position computed value

For 5 and 6…

http://www.w3.org/TR/css3-background/#background-position

“If only one value is specified, the second value is assumed to be ‘center’.”

http://dev.w3.org/csswg/cssom/#css-values

“Where CSS component values of the value can be omitted without changing the meaning of the value (e.g. initial values in shorthand properties), omit them. If this would remove all the values, then include the first allowed value.”
“E.g. margin: 20px 20px becomes margin: 20px.”


Thus…
Minimization rule: “<length> center” => “<length>”


“The B renditions of #8 and #10 are clearly wrong, as they go against the explicit text of the computed value line.”
I presume you are referring to the 2nd sentence.

That sentence is in direct conflict with the “omission” rule that CSSOM describes.  This presents an inconsistency relative to IE9 behavior which I find troubling for back-compat and other reasons.  Setting that aside for a moment….

The second sentence of computed value reads:
If three or four values are specified, two pairs of a keyword plus a length or percentage.

Does that mean that…
                center top 5px
computes to
                left 50% top 5px
rather than
                50% 5px (minimized)
or
                center top 5px (conceptually aligned with the specified value)
?

-Brian

From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
Sent: Monday, November 07, 2011 2:18 PM
To: Brian Manthos
Cc: www-style@w3.org
Subject: Re: [css3-background] background-position computed value


On Mon, Nov 7, 2011 at 2:02 PM, Brian Manthos <brianman@microsoft.com<mailto:brianman@microsoft.com>> wrote:
Sure.

Input / Specified
1              right 1px bottom 3px
2              10em bottom
3              bottom
4              left 27px bottom 5px
5              27px center
6              50% center
7              center 5px
8              right 5% bottom 10%
9              right 5px bottom 10%
10           left 5px bottom 10%

Computed (A)
1              right 1px bottom 3px
2              12345px 100%
3              50% 100%
4              left 27px bottom 5px
5              27px
6              50%
7              50% 5px
8              right 5% bottom 10%
9              right 5px bottom 10%
10           left 5px bottom 10%

Computed (B)
1              right 1px bottom 3px
2              12345px 100%
3              50% 100%
4              left 27px bottom 5px
5              27px
6              50%
7              50% 5px
8              95% 90%
9              right 5px bottom 10%
10           5px 90%

 I don't understand your #5 and #6.  Those should be "27px 50%" and "50% 50%" respectively.

The B renditions of #8 and #10 are clearly wrong, as they go against the explicit text of the computed value line.  A is correct.  (The spec doesn't disallow computing #8 as "left 95% top 90%" and #10 as "left 5px top 90%", though.)

~TJ

Received on Monday, 7 November 2011 22:45:18 UTC