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

David D. Kilzer ddkilzer at kilzer.net
Tue Jan 16 07:14:58 PST 2007


Hi Stephen,

Are you using shipping Safari, or a WebKit nightly, to do your testing?

http://nightly.webkit.org/

Dave


On Jan 16, 2007, at 7:20 AM, Stephen Deken wrote:

> Hello,
>
> 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  
> work?
>      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