[webkit-dev] contentWidth of a table row & rendering data

Stephen Deken stephen.deken at gmail.com
Tue Jan 16 05:20:04 PST 2007


This is a plea for help.

I have a project for which I need to get the rendered outline of a  
DOM element.  For my purposes, using the DOM offsetWidth and  
offsetHeight, combined with the offsetLeft and offsetTop (with the  
offsetParent's coords) gives me what I need in most cases.  However,  
when dealing with <tr> elements, it appears as though WebKit is  
returning a value of zero in all cases.

I have two questions:

      1. How difficult would it be to calculate the offsetWidth and  
offsetHeight for the <tr> element, given that it currently does not  
      2. Is there a better / more efficient way to get the rendered  
outline (box) of a DOM node?

My current code falls a bit short in some situations -- <td> cells  
don't always extend all the way to their cell edge, inline elements  
that start near the end of the line and contain a soft break appear  
to be a single block extending off of the screen, that sort of thing.

If there's a better way to go about this, please let me know.

Stephen Deken
stephen.deken at gmail.com

More information about the webkit-dev mailing list