W3C home > Mailing lists > Public > www-style@w3.org > April 2011

Re: [cssom] Element size/positioning information

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Tue, 12 Apr 2011 08:32:38 -0700
Message-ID: <BANLkTinXbo9BT6nC9+R6p3kf2rmKpoZ2_w@mail.gmail.com>
To: www-style@gtalbot.org
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, www-style list <www-style@w3.org>
On 4/11/11, Garrett Smith <dhtmlkitchen@gmail.com> wrote:
> On 4/11/11, "Gérard Talbot" <www-style@gtalbot.org> wrote:
>>
>> Le Lun 11 avril 2011 18:46, Garrett Smith a écrit :
>>> On 4/11/11, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>>>> The current OM APIs for determining the size and position of an
>>>> element are verbose and confusing.
>>> Uh huh.
>>>
>>>> Determining the Size of an Element
>>>> ==================================
>>>>
>>>> Right now there are four ways of asking for the width of an element:
>>>> elem.clientWidth, elem.scrollWidth,
>>>> elem.getBoundingClientRect().width, and
>>> Nope. The `width` property is not reliable cross-browser. That's yet
>>> another example of  AVK taking an MS APIs and changing it to make it
>>> incompatible with the very API it is purported to standardize. Can you
>>> think of a better way make browsers more interoperable?
>>>
>>>> getComputedStyle(elem,'').width (similarly for height).
>>>
>>> Uh , aren't you forgetting offsetWidth?
>>>
>>>>
>>>> It's completely unobvious what each of these do
>>> That happens when you don't read specs. (From MSDN, MDC, W3C).
>>
>>
>> Hello Garrett :)
>>
> Hey.
>
>> You have to be careful too about specs and documentation websites from
>> browser manufacturers. There are errors too in those. And browsers also
>> have bugs too, you know :)
>>
> Yeah.
>
>> There are at least 4 errors in the diagrams of this MSDN webpage:
>>
>> http://msdn.microsoft.com/en-us/library/ms533024.aspx
>>
>> 1- top and left offset properties are shown to be located between margin
>> area and padding area: this is clearly wrong.
>
> There isn't any margin area; AFAICT margin could be 0.
>
> "The sample page contains a div element that is relatively positioned
> on the page."
>
> Whether or not offsetTop includes the border width (clientTop) depends
> on the version and mode of IE. Yeah, so you can feature test that,
> There are other quirks with offsetTop that vary from browser to
> browser and depend on the element (table related elements and BODY
> tend to be problems).
>
Dammit, no that's wrong.

I remember now, it is not the clientTop of the element that is
sometimes included. That value is always excluded. It is the clientTop
ofthe element's offsetParent that varies. That was actually one of the
first pain points I brought up.
...
http://lists.w3.org/Archives/Public/www-style/2008Apr/0440.html

IIRC, Arthur Barstow proposed that to become last call to help keep
the process going, which it did. All history now.

I'm unsubscribing. I want to avoid spending too much time on thist
stuff -- nothing personal against anyone here.

Regards
-- 
Garrett
Received on Tuesday, 12 April 2011 15:33:06 GMT

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