Try this:
IntRect rect = static_cast<Element*>(node)->screenRect();
IntPoint p = m_page->chrome()->client()->screenToWindow(rect.x(), rect.y());

Which could return a coordinate relative viewport and has included scroll
offset.


>Message: 1
>Date: Mon, 05 Mar 2012 09:01:19 -0800
>From: Sam White <[email protected]>
>To: [email protected]
>Subject: [webkit-help] Computing clientX & clientY for a Node.
>Message-ID: <[email protected]>
>Content-Type: text/plain; CHARSET=US-ASCII

>Hey WebKit,

>I'm trying to compute clientX & clientY for a Node in a way that is
relative to the viewport. So far I've only found the absoluteBoundingBoxRect
function on renderObject but the rect it returns is relative to the
>document. Any help with this would be great.

>Thanks
>Sam


_______________________________________________
webkit-help mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-help

Reply via email to