W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2013

Re: [webcomponents] Adjusting offsetParent, offsetTop, offsetLeft properties in Shadow DOM

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 28 Mar 2013 13:30:11 -0400
Message-ID: <51547E23.5020108@mit.edu>
To: public-webapps@w3.org
On 3/28/13 12:49 PM, Elliott Sprehn wrote:
> var rect = node.offsetParent.getBoundingClientRect();
> node.style.top = computePosition(rect);
> node.style.left = computePosition(rect);

Nothing guarantees the result of this to be sane today, unless you have 
extra information about the precise styles of "node" and 
"node.offsetParent", as far as I know....

Or put another way, I think the code cited above is just wrong and 
shouldn't be written that way.

> Anyway I think the fundamental question here is: Is it okay to make
> offsetParent totally useless (always returns <body>) in Toolkit apps?

It's already pretty close to totally useless as far as I can tell....

-Boris
Received on Thursday, 28 March 2013 17:30:40 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 28 March 2013 17:30:41 UTC