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

It seems like you shouldn't take the transform into account since the
axis-aligned box will be too big.
ie if you were to use the getClientRects API for hit detection and you have
2 neighboring and skewed or rotated elements, their boxes will overlap.

Rik

On Thu, Nov 24, 2011 at 4:12 PM, Robert O'Callahan <robert@ocallahan.org>wrote:

> The spec needs to make clear that getClientRects() returns rectangles that
> include the effect of transforms on ancestor elements. In particular each
> box rectangle is transformed by the ancestor transforms and then we take
> the viewport axis-aligned bounding-box of the result. Existing content
> requires this and it's more useful than not taking transforms into account.
> Gecko will change to have this behavior and other browsers already do.
>
> The spec currently says to treat an SVG <foreignObject> as establishing a
> new viewport. Gecko does this, but Opera and Webkit don't. (getClientRects
> etc seems to not work inside foreignObject at all in IE9.) At least for the
> purposes of getClientRects/getBoundingClientRect, I think the spec should
> change to have <foreignObject> not establish a viewport. Geometry changes
> induced by SVG should be included in the transforms accounted for in my
> previous paragraph.
>
> Rob
> --
> "If we claim to be without sin, we deceive ourselves and the truth is not
> in us. If we confess our sins, he is faithful and just and will forgive us
> our sins and purify us from all unrighteousness. If we claim we have not
> sinned, we make him out to be a liar and his word is not in us." [1 John
> 1:8-10]
>

Received on Thursday, 1 December 2011 04:38:25 UTC