Bug 49498

Summary: focus issue with links that have tooltips
Product: WebKit Reporter: Hussam Al-Tayeb <ht990332>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cgarcia, mrobinson
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: Linux   
Attachments:
Description Flags
Patch to set the tooltip area
mrobinson: review-
Updated patch mrobinson: review+

Hussam Al-Tayeb
Reported 2010-11-13 14:43:51 PST
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.
Attachments
Patch to set the tooltip area (4.07 KB, patch)
2010-11-19 02:31 PST, Carlos Garcia Campos
mrobinson: review-
Updated patch (3.11 KB, patch)
2010-11-22 00:25 PST, Carlos Garcia Campos
mrobinson: review+
Hussam Al-Tayeb
Comment 1 2010-11-13 14:45:50 PST
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
Hussam Al-Tayeb
Comment 2 2010-11-18 10:10:54 PST
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.
Carlos Garcia Campos
Comment 3 2010-11-19 02:29:23 PST
Yes, this is because tooltip position is not updated for the same widget unless an area of the widget is set for the tooltip.
Carlos Garcia Campos
Comment 4 2010-11-19 02:31:02 PST
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
Martin Robinson
Comment 5 2010-11-19 08:49:01 PST
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.
Carlos Garcia Campos
Comment 6 2010-11-22 00:25:56 PST
Created attachment 74531 [details] Updated patch
Martin Robinson
Comment 7 2010-11-23 12:35:51 PST
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.
Martin Robinson
Comment 8 2010-11-23 12:40:50 PST
Note You need to log in before you can comment on or make changes to this bug.