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

Re: [CSSOM] getClientRects should work on collapsed ranges in elements

From: Anne van Kesteren <annevk@opera.com>
Date: Tue, 31 Aug 2010 14:01:14 +0200
To: robert@ocallahan.org, "Ojan Vafai" <ojan@chromium.org>
Cc: www-style@w3.org, "Daniel Danilatos" <danilatos@google.com>, "Julie Parent" <jparent@chromium.org>, "Tony Chang" <tony@chromium.org>, "TAMURA, Kent" <tkent@chromium.org>, "Roland Steiner" <rolandsteiner@google.com>
Message-ID: <op.viaw0cfn64w2qv@anne-van-kesterens-macbook-pro.local>
On Wed, 18 Aug 2010 23:07:36 +0200, Ojan Vafai <ojan@chromium.org> wrote:
> Those are totally valid concerns. Ideally we could spec this so that it
> would also work in the situations where inserting an empty text node  
> doesn't create a CSS box, which is what IE does, but I'm not sure how.  
> Even without that, I think this would be an improvement. It's  
> incrementally closer to
> what IE does and, in my opinion, gets closer to meeting the use-case for
> this API.

So I looked at this a bit closer and I think it is rather ugly. For the  
purposes of the API we have to pretend there are empty text nodes  
everywhere which somehow cause a box to be generated (although I would  
never expect empty text nodes to do that) in most cases (e.g. not with  
tables) which is then returned by the API. This seems really rather  
fragile and I would rather not do it. At least not in this way.

I suppose we could special case start of an element and end of an element.  
Start of an element gives you top/left of the element with height/width 0  
and end of element gives you bottom/right with height/width 0. That would  
also work for the table scenario, but it might miss others.

Input appreciated.

Anne van Kesteren
Received on Tuesday, 31 August 2010 12:01:56 UTC

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