cssom - clientTop, et v

There is no way to get the border-right and border-bottom widths.

clientTop - border-top-width
clientLeft - border-left-width
_______  - border-right-width?
_______  - border-bottom-width?


The other problem with the client* properties is that they are rounded
pixel values (at least in IE, Opera, and Safari).

The other problem I have is the name. "clientTop" does not describe a
borderTopWidth.

Would it make sense to:

1) include widths for ALL borders?
2) include floating point pixels (sub-pixels) (to avoid cumulative
rounding issues mentioned in earlier msg)
3) renames these properties to something non-conflicting so as to
avoid compatibility issues with (2)?

element.borderTopWidth
element.borderLeftWidth
element.borderRightWidth
element.borderBottomWidth

This is more complete, but still shows signs of feature envy. The
element wants properties of its style values.

Adapter/Strategy seems more appropriate. The way it would work would
be to abstract parts of the style that the element would be interested
in.

Hypothetical:
 element.getPixelValueFor("border-top-width");
 element.pxProp.marginLeftWidth

Changes would be localized to the would-be Adapter. (marginLeftWidth
is a would-be change);

The method available today is not an instance method:

// wrap in parseFloat( )
document.defaultView.getComputedStyle(element, "").borderLeftWidth;

It's in a strange place - on the defaultView - not the element. It is
too verbose and less natural.

Garrett

Received on Sunday, 9 March 2008 19:40:06 UTC