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

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

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 31 Aug 2010 15:13:10 +0200
To: "www-style list" <www-style@w3.org>, "Boris Zbarsky" <bzbarsky@mit.edu>
Message-ID: <op.via0b7sw64w2qv@anne-van-kesterens-macbook-pro.local>
On Tue, 31 Aug 2010 14:57:45 +0200, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> How should getBoundingClientRect/getClientRects (which assume that the  
> element they're called on decomposes into a set of axis-aligned boxes)  
> interact with transforms?
> For a simple testcase of a single transformed div with the functions  
> called on it, Gecko reports the rect the div would have if the transform  
> were not applied.  Webkit and Presto seem to report a bounding client  
> rect for the transformed div (so for the case of a 100x100 px square  
> rotated 45deg clockwise about the bottom-left corner they report 142px  
> width and height and 29px top).  See testcase at end of mail.
> The spec probably needs to say what the right behavior is here.  (And of  
> course also for offset* and whatnot, but at the moment I'm more  
> concerned about getClientRects.)

Bounding box is what we do for SVG so we should do that here too. Ideally  
the definition of "border box" in CSS reflects this behavior or CSS gets a  
different kind of "border box" that reflects this behavior and CSSOM View  
is updated to use that.

This reminds me. Apple was going to propose transform-aware APIs. Is  
anything coming?

Anne van Kesteren
Received on Tuesday, 31 August 2010 13:13:46 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:49 UTC