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

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

From: Ojan Vafai <ojan@chromium.org>
Date: Wed, 18 Aug 2010 14:07:36 -0700
Message-ID: <AANLkTikibaWfBsCOj690LS2PS8OPau4U6sn+aL=Y298P@mail.gmail.com>
To: robert@ocallahan.org
Cc: Anne van Kesteren <annevk@opera.com>, 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>
On Fri, Aug 13, 2010 at 4:55 AM, Robert O'Callahan <robert@ocallahan.org>wrote:

> Ojan suggested that range.getClientsRects on a collapsed range should give
> you the same result as if you had inserted an empty text node at that
> position in the DOM and called getClientRects on that text node.
> I have two weak concerns about that approach. If inserting an empty text
> node into the DOM can cause significant changes in layout in some
> situations, it could be very difficult to implement ... but right now I
> can't think of any such cases. Also, there are situations where inserting an
> empty text node into the DOM does not create any CSS box for the text node,
> so getClientRects will return an empty list; applications would have to deal
> with that possibility.
> Apart from those concerns, I think Ojan's suggestion is fine.

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.

Received on Wednesday, 18 August 2010 21:08:25 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:37 UTC