Re: (DOM)Compute the sum of width of elements contained in blockleve element
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: (DOM)Compute the sum of width of elements contained in blockleve element

From: Thomas 'PointedEars' Lahn <PointedEars@web.de>
Date: Wed Feb 08 2006 - 15:11:06 CET

Thomas 'PointedEars' Lahn wrote:

> Luke Matuszewski wrote:
>> My question is about returned elements [...] - do they have some property
>> which will indicate the actual width which they take ?
>
> - getComputedStyle(objRef, pseudoElem).width
> (standards compliant: Gecko, Opera)
> [...]

That is not quite correct. getComputedStyle() as introduced in W3C DOM
Level 2 Style returns (a reference to) a CSSStyleDeclaration object which
does not have a `width' property nor does it have a namedItem() method to
allow for this property access in ECMAScript implementations. So the fully
standards compliant DOM access would be

  getComputedStyle(objRef, pseudoElem).getPropertyValue("width")

which is supported only in the Gecko DOM (where the global Window object
appears to implement the ViewCSS interface). It should also be noted that
of all the DOMs tested, the KHTML DOM (Konqueror, Safari), Version 3.5.1
(Konqueror 3.5.1), does not appear to support any of the mentioned access
methods.

PointedEars
Received on Mon May 1 03:10:08 2006