W3C home > Mailing lists > Public > public-fx@w3.org > October to December 2013

Re: [css-transforms][svg11] Effect of perspective and 3D transform on SVG bounding box

From: Dirk Schulze <dschulze@adobe.com>
Date: Mon, 14 Oct 2013 22:51:42 -0700
To: "robert@ocallahan.org" <robert@ocallahan.org>
CC: "public-fx@w3.org" <public-fx@w3.org>
Message-ID: <B9B7EF5F-DB60-46D8-A171-471EDA492A9A@adobe.com>

On Oct 15, 2013, at 7:21 AM, Robert O'Callahan <robert@ocallahan.org> wrote:

> On Tue, Oct 15, 2013 at 1:10 AM, Dirk Schulze <dschulze@adobe.com> wrote:
> On Oct 15, 2013, at 12:26 AM, Robert O'Callahan <robert@ocallahan.org> wrote:
> > 3) The transformations of its children depend on the 'perspective-origin' of the parent.
> 
> I do not understand how this would be the case? 'perspective-origin' is like two perspective projection matrices that surround the one specified by the 'perspective' property. Or to be clear: The perspective projection matrix is specified by the 'perspective' and 'perspective-origin' properties. This matrix gets multiplied with the transformation matrix that is specified by the 'transform' and 'transform-origin' properties.
> 
> You are right that 'transform', 'perspective' and 'perspective-origin' may depend on the objects bounding box (which depends on the transformation and oob of the children). I do not see a requirement of the children to know the 'perspective-origin' of the parent? Also, why would it then just be the 'perspective-origin' and not the 'perspective' as well? From the spec [1]:
> 
> ""
> It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element.
> ""
> 
> Yes, it depends on the value of "perspective" as well.
> 
> The perspective matrix on the parent affects where the child gets rendered within the parent. The bounding-box of the parent depends on where the child gets rendered. Is this unclear?

I assume you are referencing the following text [1]:

""
multiply the accumulated matrix with the perspective matrix on the elementís containing block (if any). That containing block is not necessarily a member of the 3D rendering context.
""

Even if the term "containing block" is misleading, it indeed suggests that the perspective matrix (perspective projection matrix) from one of the ancestors establishing a 3D context is taken into account.

To which box do implementations resolve percentage values for 'perspective' in HTML? Still to the value returned by getClientRects() / getBoundingClientRect() ? Does getBoundingClientRect() include any transforms from children? IIRC it doesn't even if CSS Transforms still says[2]:

""
Transforms affect the results of the Element Interface extensions getClientRects() and getBoundingClientRect()
""

which would naturally just be the case for SVG where getClientRects() returns the object bounding box.

I would like to understand what implementations do on HTML before we resolve on SVG. We might even consider that perspective is not included in the SVG definition of object bounding box then.

Greetings,
Dirk

[1] http://dev.w3.org/csswg/css-transforms/#perspective-matrix-computation
[2] http://dev.w3.org/csswg/css-transforms/#module-interactions


> 
> Rob
> -- 
> Jtehsauts  tshaei dS,o n" Wohfy  Mdaon  yhoaus  eanuttehrotraiitny  eovni le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o  Whhei csha iids  teoa stiheer :p atroa lsyazye,d  'mYaonu,r  "sGients  uapr,e  tfaokreg iyvoeunr, 'm aotr  atnod  sgaoy ,h o'mGee.t"  uTph eann dt hwea lmka'n?  gBoutt  uIp  waanndt  wyeonut  thoo mken.o w  
Received on Tuesday, 15 October 2013 05:52:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:49:47 UTC