W3C home > Mailing lists > Public > www-style@w3.org > December 2011

Re: [cssom-view] Correction and clarification for the coordinate systems of getClientRect/getBoundingClientRect

From: Yehuda Katz <wycats@gmail.com>
Date: Thu, 1 Dec 2011 13:57:32 -0800
Message-ID: <CAMFeDTX=S1-7QhXVSHu07F47zk7Us_nsahHKGCKtKjikqnZCxQ@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Simon Fraser <smfr@me.com>, Rik Cabanier <cabanier@gmail.com>, robert@ocallahan.org, www-style <www-style@w3.org>
Yehuda Katz
(ph) 718.877.1325

On Thu, Dec 1, 2011 at 1:53 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> On Thu, Dec 1, 2011 at 1:44 PM, Simon Fraser <smfr@me.com> wrote:
> > On Dec 1, 2011, at 9:17 AM, Rik Cabanier wrote:
> >> That was just an example.
> >> My point was that information is lost if you append all the transforms.
> >> Better to give back the untransformed bounds and tell the user to do the
> >> math himself.
> >
> > That math is way too hard for the average web developer, if you need to
> take
> > 3D transforms and perspective on ancestor elements into account.
> >
> > The better solution would be to have getBoundingClientQuads(), and a
> > pointInQuad() helper method.
> We've had this discussion before.  There's a bunch of information and
> variants of rects and quads that *might* be useful to expose.  Someone
> needs to sit down and spend the time to figure out *what* to expose
> and how to do it all sanely.  I don't think adding things piecemeal
> will give us a good result in the end.

Unfortunately, this means that for the forseeable future, doing hit
detection and direct manipulation on transformed elements (very, very
common on mobile devices) will continue to be complicated, error-prone, and
somewhat outside the reach of the average developer :(

> In particular, there are a handful of orthogonal options that specify
> what information you can get out.  I suspect a solution built around
> those would be necessary.
> ~TJ
Received on Thursday, 1 December 2011 21:59:04 UTC

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