Thank you.

So to get absolute co-ordinates of each Render Object, I need to do
something like:

int absolute_x = 0;
int absolute_y = 0;

parent = renderObject.getParent()

while (parent != RenderBody) {
     absolute_x += parent.getX();
     absolute_y += parent.getY();

}

Is that right?

Thank you.



On Sun, May 31, 2009 at 3:11 PM, Eric Seidel <macd...@gmail.com> wrote:
> To expand Darin's answer:   there are exceptions to the
> relative-to-containing-block rule.  SVG results for example are absolute
> (mostly).  There are also hacks the the DRT output, where we "lie" about
> metrics in order to keep consistent with historical results (to minimize the
> scope of a single patch).  If you're trying to use DRT for anything other
> than testing, you will likely need to fork WebCore's RenderTreeAsText.cpp
> and SVGRenderTreeAsText.cpp substantially to fit your needs.
> -eric
> On Sun, May 31, 2009 at 10:19 AM, Darin Adler <da...@apple.com> wrote:
>>
>> Coordinates in DumpRenderTree output are relative to the containing block,
>> not absolute.
>>
>>    -- Darin
>>
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev@lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to