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

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

From: Robert O'Callahan <robert@ocallahan.org>
Date: Fri, 25 Nov 2011 13:12:06 +1300
Message-ID: <CAOp6jLYTCTYMwGVNSyvum7SbGfSsOh8GU59j5dRa+Z+CT1T7rw@mail.gmail.com>
To: www-style <www-style@w3.org>
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 Friday, 25 November 2011 00:12:42 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:46 GMT