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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2389073002: Fix link's hover state if the link under scrollbar (Closed)
Patch Set: add test 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/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 149cd32f36b9d1f833d98c706a001b902e5c6781..e043562af96477ad96ade61819716c96da524e67 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -3457,7 +3457,7 @@ MouseEventWithHitTestResults Document::performMouseEventHitTest(
layoutViewItem().hitTest(result);
if (!request.readOnly())
- updateHoverActiveState(request, result.innerElement());
+ updateHoverActiveState(request, result.innerElement(), result.scrollbar());
if (isHTMLCanvasElement(result.innerNode())) {
PlatformMouseEvent eventWithRegion = event;
@@ -5964,22 +5964,23 @@ static LayoutObject* nearestCommonHoverAncestor(LayoutObject* obj1,
}
void Document::updateHoverActiveState(const HitTestRequest& request,
- Element* innerElement) {
+ Element* innerElement,
+ bool hasScrollbar) {
DCHECK(!request.readOnly());
- if (request.active() && m_frame)
+ if (request.active() && m_frame && !hasScrollbar)
m_frame->eventHandler().notifyElementActivated();
- Element* innerElementInDocument = innerElement;
+ Element* innerElementInDocument = hasScrollbar ? nullptr : innerElement;
while (innerElementInDocument && innerElementInDocument->document() != this) {
innerElementInDocument->document().updateHoverActiveState(
- request, innerElementInDocument);
+ request, innerElementInDocument, hasScrollbar);
innerElementInDocument = innerElementInDocument->document().localOwner();
}
updateDistribution();
Element* oldActiveElement = activeHoverElement();
- if (oldActiveElement && !request.active()) {
+ if (oldActiveElement && (!request.active() || hasScrollbar)) {
// The oldActiveElement layoutObject is null, dropped on :active by setting
// display: none, for instance. We still need to clear the ActiveChain as
// the mouse is released.

Powered by Google App Engine
This is Rietveld 408576698