[webkit-help] How can I get a pointer to RenderBox for a particular Html Div Element

n179911 n179911 at gmail.com
Sun Mar 7 23:20:17 PST 2010

I found a function which I think fits my need. It is 'renderBox() in Node.h'
But Can you please tell me why the comment said 'Use these two methods
with caution'?

   // Use these two methods with caution.
    RenderBox* renderBox() const;
    RenderBoxModelObject* renderBoxModelObject() const;

On Sun, Mar 7, 2010 at 2:59 PM, n179911 <n179911 at gmail.com> wrote:
> HI,
> If I have a pointer to a HTMLDivElement.h, how can I get its
> corresponding RenderBox for it?
> I know there is a 'renderer() method which I can get its RenderObject,
>  RenderObject *o = element->renderer();
> but how can I get the RenderBox?
> I see there is a 'toRenderBox method which convert RenderObject to
> RenderBox object:
> inline RenderBox* toRenderBox(RenderObject* object)
> But the class which has this method is RenderBox (which i don't know
> how to get from a DIV element).
> Thank you for any pointer.

More information about the webkit-help mailing list