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

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

From: Robert O'Callahan <robert@ocallahan.org>
Date: Fri, 13 Aug 2010 23:55:27 +1200
Message-ID: <AANLkTikjtqxU0P65o86-nUYFO==qGEYeuVAA8CvtqOMr@mail.gmail.com>
To: Anne van Kesteren <annevk@opera.com>
Cc: Ojan Vafai <ojan@chromium.org>, 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>
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.

Rob
-- 
"Now the Bereans were of more noble character than the Thessalonians, for
they received the message with great eagerness and examined the Scriptures
every day to see if what Paul said was true." [Acts 17:11]
Received on Friday, 13 August 2010 11:55:59 GMT

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