Re: [CSSOM] Interaction of getBoundingClientRect/getClientRects with transforms

On Wed, Sep 1, 2010 at 2:12 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

>  <span style="-moz-transform: rotate(45deg);">x<br>x</span>
>>>>>
>>>>

>  <!DOCTYPE HTML>
> <html>
>  <head>
>    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
>    <style>
>      .r {
>
>        -moz-transform: rotate(45deg);
>        -moz-transform-origin: bottom left;
>        -webkit-transform: rotate(45deg);
>        -webkit-transform-origin: bottom left;
>        -o-transform: rotate(45deg);
>        -o-transform-origin: bottom left;
>        background: yellow;
>      }
>    </style>
>  </head>
>  <body>
>    <span class="r">Some עִבְרִית text</span>
>  </body>
> </html>


> will render with three boxes, each rotated separately, because we create
> separate boxes for different-direction parts of the inline.
>


> <!DOCTYPE HTML>
> <html>
>  <head>
>    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
>  </head>
>  <body>
>    <span style="background: yellow">
>      <span style="background: orange">Some עִבְרִית</span> 2
>    </span>
>  </body>
> </html>
>
> (in this case, the box for "2" comes between the two different-direction
> boxes for the inner inline; this is pretty interoperably implemented in
> Gecko/Webkit/Presto as far as I can tell; I'm pretty sure Trident handles it
> right too).
>
> For what it's worth, I just tested and Opera does the same thing as Gecko,
> both in terms of creating separate boxes in the bidi cases above and in
> terms of what it does with transforms on multi-box inlines.


On Wed, Sep 1, 2010 at 2:19 AM, Simon Fraser <smfr@me.com> wrote:

> Position: relative only lets you offset the boxes horizontally or
> vertically, so I don't think it informs on this issue. What do you expect to
> happen when a split <span> has a rotation transform?
>

I can't imagine that any web developer would expect or understand this
behavior. I don't have any conception of implementation difficulty, but I
would expect a split <span> with a rotation transform to rotate bases on
it's bounding box.

Ojan

Received on Tuesday, 21 September 2010 07:32:17 UTC