Re: [css3-transforms] Why do we need a 'perspective' property?

On Feb 6, 2012, at 8:56 PM, Aryeh Gregor wrote:

> On Mon, Feb 6, 2012 at 2:48 PM, Simon Fraser <smfr@me.com> wrote:
>> [Please don't cc: people who are on www-style anyway]
> 
> [I don't know who's on www-style, and personally I prefer to be CCd
> even if I'm on the list.  Is there an established convention here?]
> 
>> The point of the perspective property is to provide a common perspective
>> for child elements (and, if you're in a 3d rendering context, for all members
>> of that context). This is especially useful if the children have different x/y offsets
>> due to normal CSS layout; they'll still share a common perspective origin.
>> 
>> This avoids the need to have multiple transformed elements all specify
>> perspective() in their transforms, with possibly different perspective origins.
> 
> Okay; so what's wrong with
> 
>  <div style="transform:perspective(1000px)">
> 
> instead of
> 
>  <div style="perspective:1000px">
> 
> ?  Is it just that they work differently if you use transform-style:
> flat?

They do, that is correct. If you set the perspective via the transform property,
then you also need transform-stye: preserve-3d so that child elements share
the same 3D rendering context. But I don't think you want 'preserve-3d' to
be the default behavior here either, because it will cause children rotated
in Y to intersect with the background of the element with perspective. You lose
the ability to use an element as a "3D stage", and keep the 3D transforms contained
within it.

> That just makes me think transform-style: flat should go away
> even more -- we could get rid of three out of the four properties that
> 3D transforms add.

In the copious content that we've written, we've made extensive use of
the transform-style property, both preserve-3d and flat, to control the
scope of 3D rendering contexts. I think we need to keep it.

Simon

Received on Monday, 6 February 2012 20:12:29 UTC