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

zaheer ahmad zaheer.mot at gmail.com
Wed Feb 10 07:38:00 PST 2010


On Wed, Feb 10, 2010 at 5:44 PM, Vivek Satpute <vivekonline86 at gmail.com>wrote:

> Hi,
>
> I started GtkLauncher program and it has loaded a webpage which have many
> links to other webpages. If I click on any link, then webkit calls
> RenderInline::addFocusRingRects() function before calling
> GraphicsContext::drawFocusRing().
>
> If I am not making any mistake, RenderInline::addFocusRingRects() functions
> decides the
> (rect_x, rect_y, width, height) parameters to draw a dotted rectangle
> around the link.
>
> My question is, If I have link "News" on webpage. So, if I click on
> character i.e. N, e, w or s
> of link "News", my clicked point (x, y) changes. That (x, y) I get in
> webkit_web_view_button_press_event()
> in variable *GdkEventButton* event*. Even if clicked location (x, y)
> changes, the (rect_x, rect_y) point
> of Rectangle (which is to be drawn over link) always remains same for same
> link "News".
>
> So, how this is achieved in webkit? How webkit decides (rec_x, rect_y)
> co-ordinate of Rectangle (to be drawn
> around link) from clicked co-ordinated (x, y) in *GdkEventButton* event ?
> *

It is determined by hit test you can check this mail
http://marc.info/?l=webkit-dev&m=122202397417406 for details

> *
>
> *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.
>
In this case there can be multiple choices since you are not looking for a
precise match and i think you would have to traverse all the nodes and get
that information based on their distance..something similar to tab
navigation - https://bugs.webkit.org/show_bug.cgi?id=18662 (pls correct me
if there is a better way)


> *
> *Thanks in advance,
> Vivek
>
> Thanks
Zaheer

> _______________________________________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-help
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20100210/b2cf891f/attachment.html>


More information about the webkit-help mailing list