I found a bug in webkit gtk .If there are many images with links on the same horizontal line. If I hover over first one and it shows the title (tooltip) then move the mouse horizontally to the next link right of it, the second tooltip will appear on first link. A workaround is moving the mouse vertically a bit then moving it to next link. I'm using 1.3.6 from git.
This happens only when the links are directly adjacent. sometimes second link tooltiip doesn't show till I move the mouse around then back to second link
To reproduce, open http://en.wikipedia.org/wiki/Webkit 1. Put mouse over "Discussion" first (not "Article"). 2. Move the mouse horizontally (not vertically) over "Article". 3. Watch tooltip over wrong link.
Yes, this is because tooltip position is not updated for the same widget unless an area of the widget is set for the tooltip.
Created attachment 74364 [details] Patch to set the tooltip area Set the area of the widget where the tooltip should be shown when a new tooltip is set. Since the widget is the same (the view), if the tooltip area is not set and a new tooltip is triggered while the previous one is still visible, the text of the tooltip is updated but its position doesn't change
Comment on attachment 74364 [details] Patch to set the tooltip area View in context: https://bugs.webkit.org/attachment.cgi?id=74364&action=review Great! Just a couple suggestions. > WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:526 > + if (Node* node = hit.innerNonSharedNode()) > + webkit_web_view_set_tooltip_area(m_webView, node->getRect()); > + else > + webkit_web_view_set_tooltip_area(m_webView, IntRect()); I think it might be cleaner to simply have this code update the WebView private data structure. > WebKit/gtk/webkit/webkitwebview.cpp:1645 > + gtk_tooltip_set_tip_area(tooltip, NULL); NULL should be 0 here. > WebKit/gtk/webkit/webkitwebview.cpp:4756 > +void webkit_web_view_set_tooltip_area(WebKitWebView* webView, const IntRect& area) > +{ > +#if GTK_CHECK_VERSION(2, 12, 0) > + WebKitWebViewPrivate* priv = webView->priv; > + priv->tooltipArea = area; > + // query-tooltip will be triggered by webkit_web_view_set_tooltip_text(). > +#else > + // TODO: Support older GTK+ versions > + // See http://bugs.webkit.org/show_bug.cgi?id=15793 > + notImplemented(); > +#endif > +} > + > /** I think the conditional logic is unnecessarily here. It's technically correct, but this method doesn't use any GTK+ API calls that don't exist in < 2.12.0. I prefer simply scrapping this and fiddling the private structure directly. Mainly this is because webkitwebview.cpp is bordering on 5000 lines.
Created attachment 74531 [details] Updated patch
Comment on attachment 74531 [details] Updated patch View in context: https://bugs.webkit.org/attachment.cgi?id=74531&action=review Looks great. There is only one tiny thing that I'll change before landing. > WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:526 > + WebKitWebViewPrivate* priv = m_webView->priv; > + Node* node = hit.innerNonSharedNode(); > + priv->tooltipArea = node ? node->getRect() : IntRect(); This should probably just be m_webView->priv->tooltipArea = ... I'll fix that and land it.
Committed r72621: <http://trac.webkit.org/changeset/72621>