[webkit-dev] hit testing?

Simon Fraser simon.fraser at apple.com
Sun Nov 30 19:15:15 PST 2008

On Nov 27, 2008, at 7:57 AM, Mark Wyszomierski wrote:

> Hi,
> I'm wondering if webkit exposes any method to do a virtual hit  
> testing via javascript. I'm looking to use some method like:
>     function hittest(int x, int y)
>     {
>         for (all nodes in DOM) {
>             return top-most node that gets intersected;
>         }
>         return null;
>     }
> Not sure if this is the right place to asking, I cannot find  
> information elsewhere. I'm targeting only safari which I believe  
> uses webkit, so, I just wanted to know if any such functionality in  
> the base might exist so a javascript function might exist,

Have a look at document.elementFromPoint()


More information about the webkit-dev mailing list