RE: [cssom-view] padding edge / border edge for offsetTop/offsetLeft?

This may be a very basic question so I hope you bear with me. There is something I do not grok about measuring offsetLeft from the parent's left padding edge to the element's own left border edge, as defined in CSSOM-View: adding up offsetLeft values defined this way up the offsetParent chain will 'miss' the border for each element along the chain, resulting in an incomplete aggregate offset. As others have noted, simply adding offsets in this manner does not 'work' today but if this is how we define offsetLeft and offsetTop then clearly it cannot.

The same comment applies to offsetTop, of course.

Moreover, and rather confusingly imo, offsetWidth and offsetHeigh include the border. Lastly, IE legacy behavior seems to measure offsetLeft/Top from border edge to border edge in most cases I have tried. Opera 9.5b1 seems to be in agreement; Safari 3.1 and FF3 seem to comply with the current definition.

Overall, I do not yet understand the trade-offs involved in this set of definitions.

Received on Thursday, 24 April 2008 22:30:34 UTC