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

Re: [CSSOM] offsetWidth, offsetLeft issues

From: Anne van Kesteren <annevk@opera.com>
Date: Fri, 13 Aug 2010 11:36:32 +0200
To: "Ojan Vafai" <ojan@chromium.org>, "Robert O'Callahan" <robert@ocallahan.org>
Cc: "Erik Arvidsson" <arv@chromium.org>, www-style@w3.org
Message-ID: <op.vhdea4tu64w2qv@anne-van-kesterens-macbook-pro.local>
On Sat, 17 Oct 2009 05:03:24 +0200, Robert O'Callahan  
<robert@ocallahan.org> wrote:
> On Sat, Oct 17, 2009 at 1:10 PM, Ojan Vafai <ojan@chromium.org> wrote:
>> On Wed, Oct 14, 2009 at 1:17 PM, Robert O'Callahan  
>> <robert@ocallahan.org>wrote:
>>> On Thu, Oct 15, 2009 at 8:50 AM, Erik Arvidsson <arv@chromium.org>  
>>> wrote:
>>>> The width and height of getBoundingClientRect is always the same as
>>>> offsetWidth and offsetHeight.
>>> I don't really care about this one. offsetWidth and offsetHeight are
>>> really bad legacy features.
>> No argument there. But we should at least make them as sane as possible,
>> no? In the case of tables with captions, it makes more sense to include  
>> the caption. Given that IE already does this, it seems likely to  
>> maximize
>> compatibility, or at least not make it worse.
> It seems to me that right now the CSSOM spec is a little vague on this
> matter. On the offset* properties it talks about "the border-edge of  
> element A", when it really needs to specify a particular CSS box (or  
> union of CSS
> boxes).

I changed it to talk about boxes. It simply picks the first CSS layout box  
associated with the element as that is what needs to happen for inline  
boxes. I could add an exception for <table> elements I suppose but do we  
really want to do that?

> I don't really mind if the spec changes so that offsetWidth and  
> offsetHeight
> match the size of getBoundingClientRect. That would make them include the
> table caption. However, I can't promise that we'll change Gecko to  
> match. It seems almost any change to our offset* implementation produces  
> regressions in Web content, perhaps because there is browser-sniffing  
> code that makes
> assumptions about what we currently do. I'd rather just give up on  
> offset* and forget about them and concentrate on making
> getClientRects/getBoundingClientRect useful and interoperable across
> browsers.

Since we are keeping the features around we should strive to reach  
interoperability in my opinion. This will require changes and hopefully  
experimental deployment can further help guide the specification.

Anne van Kesteren
Received on Friday, 13 August 2010 09:37:12 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 11 February 2015 12:34:40 UTC