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

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

Issue 2523903002: Document::updateHoverActiveState only cancel hover and active state when hitting native scrollbar (Closed)
Patch Set: 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 c44b227186644837c5a4a628e8e496940d1075d4..8dca1ca509c3aad6df7307f899262ad9e0fb4d5e 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -3523,8 +3523,11 @@ MouseEventWithHitTestResults Document::performMouseEventHitTest(
HitTestResult result(request, documentPoint);
layoutViewItem().hitTest(result);
- if (!request.readOnly())
- updateHoverActiveState(request, result.innerElement(), result.scrollbar());
+ if (!request.readOnly()) {
+ updateHoverActiveState(
+ request, result.innerElement(),
+ result.scrollbar() && result.scrollbar()->isOverlayScrollbar());
+ }
if (isHTMLCanvasElement(result.innerNode())) {
PlatformMouseEvent eventWithRegion = event;
@@ -6019,22 +6022,23 @@ static LayoutObject* nearestCommonHoverAncestor(LayoutObject* obj1,
void Document::updateHoverActiveState(const HitTestRequest& request,
Element* innerElement,
- bool hitScrollbar) {
+ bool hitOverlayScrollbar) {
bokan 2016/11/23 15:07:50 I think the distinction is native vs custom rather
DCHECK(!request.readOnly());
- if (request.active() && m_frame && !hitScrollbar)
+ if (request.active() && m_frame && !hitOverlayScrollbar)
m_frame->eventHandler().notifyElementActivated();
- Element* innerElementInDocument = hitScrollbar ? nullptr : innerElement;
+ Element* innerElementInDocument =
+ hitOverlayScrollbar ? nullptr : innerElement;
while (innerElementInDocument && innerElementInDocument->document() != this) {
innerElementInDocument->document().updateHoverActiveState(
- request, innerElementInDocument, hitScrollbar);
+ request, innerElementInDocument, hitOverlayScrollbar);
innerElementInDocument = innerElementInDocument->document().localOwner();
}
updateDistribution();
Element* oldActiveElement = activeHoverElement();
- if (oldActiveElement && (!request.active() || hitScrollbar)) {
+ if (oldActiveElement && (!request.active() || hitOverlayScrollbar)) {
// 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