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

Re: [css3-2d-transforms][css3-3d-transforms] Clarify equivalency with position: relative

From: Simon Fraser <smfr@me.com>
Date: Mon, 15 Nov 2010 21:56:27 -0800
Cc: www-style list <www-style@w3.org>
Message-id: <2894FCD9-48EB-4828-BA48-92485D07F4FE@me.com>
To: Sylvain Galineau <sylvaing@microsoft.com>
On Oct 22, 2010, at 7:55 pm, Sylvain Galineau wrote:

> In CSS3 2D Transforms[1], we have: 
> 
> # The transform property does not affect the flow of the content 
> # surrounding the transformed element. However, the value of the 
> # overflow area takes into account transformed elements. This 
> # behavior is similar to what happens when elements are translated 
> # via relative positioning.
> 
> In CSS3 3D Transforms [2] :
> 
> # The object acts as though position: relative has been specified, but also acts as a containing block for fixed positioned descendants.
> 
> This language is rather stronger e.g. it could be read as saying top and left position the element like they would a position:relative 
> element. However, in the perspective property definition [3], we have:
> 
> # ...It also establishes a containing block (somewhat similar to position:relative), 
> 
> Which would imply it's not supposed to act as though it was position:relative.

This is the correct interpretation. I agree that the wording needs work. A better way to state it might be:

Transforms affect an element in the same way that position: relative does. Transforms do not affect the pre-transformed size or position of the element or the layout of surrounding elements, but do affect overflow in the same way that position: relative does.

Transforms do imply position: relative. In other words, if you transform a position: static element, the 'top' and 'left' properties do not suddenly apply.

Transforms do make an element the containing block for positioned (absolute or relative) descendants. In WebKit, we also treat transformed elements as the containing block for fixed position descendants, but there's some debate over whether this is the appropriate behavior.

Transforms are considered to apply "after" the positioning. So, a position: fixed element that is also transformed will still be fixed relative to the viewport, with the transform applying based on the pre-transformed location.

Simon
Received on Tuesday, 16 November 2010 05:57:04 GMT

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