Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(926)

Unified Diff: third_party/WebKit/Source/web/ChromeClientImpl.cpp

Issue 2389073002: Fix link's hover state if the link under scrollbar (Closed)
Patch Set: Merge patch-2467693002 to fix testcase failed in OSX Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/ChromeClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
index 9a15330d50765bcedde5fba60c91fe238ad266b7..e9dc1bc2882027b2300d8791f780a59816feb32d 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -627,18 +627,25 @@ void ChromeClientImpl::showMouseOverURL(const HitTestResult& result) {
return;
WebURL url;
- // Find out if the mouse is over a link, and if so, let our UI know...
- if (result.isLiveLink() && !result.absoluteLinkURL().getString().isEmpty()) {
- url = result.absoluteLinkURL();
- } else if (result.innerNode() && (isHTMLObjectElement(*result.innerNode()) ||
- isHTMLEmbedElement(*result.innerNode()))) {
- LayoutObject* object = result.innerNode()->layoutObject();
- if (object && object->isLayoutPart()) {
- Widget* widget = toLayoutPart(object)->widget();
- if (widget && widget->isPluginContainer()) {
- WebPluginContainerImpl* plugin = toWebPluginContainerImpl(widget);
- url = plugin->plugin()->linkAtPosition(
- result.roundedPointInInnerNodeFrame());
+
+ // Ignore URL if hitTest include scrollbar since we might have both a
+ // scrollbar and an element in the case of overlay scrollbars.
+ if (!result.scrollbar()) {
+ // Find out if the mouse is over a link, and if so, let our UI know...
+ if (result.isLiveLink() &&
+ !result.absoluteLinkURL().getString().isEmpty()) {
+ url = result.absoluteLinkURL();
+ } else if (result.innerNode() &&
+ (isHTMLObjectElement(*result.innerNode()) ||
+ isHTMLEmbedElement(*result.innerNode()))) {
+ LayoutObject* object = result.innerNode()->layoutObject();
+ if (object && object->isLayoutPart()) {
+ Widget* widget = toLayoutPart(object)->widget();
+ if (widget && widget->isPluginContainer()) {
+ WebPluginContainerImpl* plugin = toWebPluginContainerImpl(widget);
+ url = plugin->plugin()->linkAtPosition(
+ result.roundedPointInInnerNodeFrame());
+ }
}
}
}
« no previous file with comments | « third_party/WebKit/Source/core/page/ChromeClient.cpp ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698