[webkit-help] Howto Calculate x, y points for GraphicsContext::drawFocusRing()

Ariya Hidayat ariya.hidayat at gmail.com
Thu Feb 11 07:19:58 PST 2010

> Actually, I want to increase active area of links, in such a way that event
> if I clicked below the link,
> (i.e. not exactly over the link) the nearer link should get selected and
> gets loaded. Right now, I have to click exactly over the link.

I guess this is the reason you asked the endless hit test questions in
the separate thread? If only you would have told us your objective

There are tons of ways to do that. Two I can think of:

(1) Find all links in the page and calculate the distance to your
click position. Pick the nearest one (or whatever algorithm you use).

(2) "Probe" in the vicinity of your click position for any presence of
others links. An example I show in
does the same, albeit for any type of elements instead of only links.


Ariya Hidayat

More information about the webkit-help mailing list