W3C home > Mailing lists > Public > public-css-bugzilla@w3.org > April 2012

[Bug 16705] transform-origin with just one argument 'top' or 'bottom' not well defined

From: <bugzilla@jessica.w3.org>
Date: Sat, 14 Apr 2012 19:20:15 +0000
To: public-css-bugzilla@w3.org
Message-Id: <E1SJ8W7-0008Ky-H2@jessica.w3.org>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=16705

--- Comment #1 from Aryeh Gregor <ayg@aryeh.name> 2012-04-14 19:20:14 UTC ---
It could be clearer.  The idea is that due to the first paragraph, "top" is the
same as "top center".  This is in turn the same as "center top" -- "top" can
only refer to the vertical component, so by process of elimination "center"
refers to the horizontal component, regardless of order.

This is how 'background-position' has always worked.  It's instructive to look
at how CSS 2.1 defines it:
<http://www.w3.org/TR/CSS2/colors.html#propdef-background-position>.  By
contrast, I now notice that the keywords aren't defined at all.

We could change the quoted part (and the following paragraph, which was not
quoted in comment 0) to something like:

"""
If only one value is specified, the second value is assumed to be ‘center’. If
one or two values are specified, the third value is assumed to be ‘0px’.

If one of the first two values is ‘left‘ or ‘right‘, that represents the
horizontal position and the other of the first two values represents the
vertical position (regardless of order).  Likewise, if one of the first two
values is ‘top‘ or ‘bottom‘, that represents the vertical position and the
other represents the horizontal position.  In any other case, the first value
represents the horizontal position and the second represents the vertical
position.

The third value always represents the Z position.

<percentage> and <length> for the first two values represent an offset of the
transform origin from the top left corner of the element's bounding box. 
Keywords are the same as the equivalent percentages: ‘left‘ and ‘top‘ are 0%,
‘center‘ is 50%, and ‘right‘ and ‘bottom‘ are 100%.
"""

Or we could just copy CSS 2.1's wording and adapt it for the third coordinate. 
That might be less confusing.  I don't think we want to normatively reference
CSS 2.1, because percentages mean something different for 'background-position'
than for 'transform-origin' (although they're parsed the same).

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Saturday, 14 April 2012 19:20:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 14 April 2012 19:20:19 GMT