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

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

Issue 2784313002: Change hittest node to be scrollbar's parent when hittest include a scrollbar (Closed)
Patch Set: mustaq comments addressed Created 3 years, 8 months 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 6dcfb95222660dd619731a2f9d0b19cf1815fbb9..12ad175b8be101a7fc4358d9ca1ed15699f619ea 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -234,7 +234,6 @@
#include "platform/network/ContentSecurityPolicyParsers.h"
#include "platform/network/HTTPParsers.h"
#include "platform/network/NetworkStateNotifier.h"
-#include "platform/scroll/Scrollbar.h"
#include "platform/scroll/ScrollbarTheme.h"
#include "platform/text/PlatformLocale.h"
#include "platform/text/SegmentedString.h"
@@ -3652,7 +3651,7 @@ MouseEventWithHitTestResults Document::performMouseEventHitTest(
layoutViewItem().hitTest(result);
if (!request.readOnly())
- updateHoverActiveState(request, result.innerElement(), result.scrollbar());
+ updateHoverActiveState(request, result.innerElement());
if (isHTMLCanvasElement(result.innerNode())) {
HitTestCanvasResult* hitTestCanvasResult =
@@ -6175,29 +6174,17 @@ static LayoutObject* nearestCommonHoverAncestor(LayoutObject* obj1,
// TODO(mustaq) |request| parameter maybe a misuse of HitTestRequest in
// updateHoverActiveState() since the function doesn't bother with hit-testing.
void Document::updateHoverActiveState(const HitTestRequest& request,
- Element* innerElement,
- Scrollbar* hitScrollbar) {
+ Element* innerElement) {
DCHECK(!request.readOnly());
if (request.active() && m_frame)
m_frame->eventHandler().notifyElementActivated();
- Element* innerElementInDocument = hitScrollbar ? nullptr : innerElement;
- // Replace the innerElementInDocument to be srollbar's parent when hit
- // scrollbar
- if (hitScrollbar) {
- ScrollableArea* scrollableArea = hitScrollbar->getScrollableArea();
- if (scrollableArea && scrollableArea->layoutBox() &&
- scrollableArea->layoutBox()->node() &&
- scrollableArea->layoutBox()->node()->isElementNode()) {
- innerElementInDocument =
- toElement(hitScrollbar->getScrollableArea()->layoutBox()->node());
- }
- }
+ Element* innerElementInDocument = innerElement;
while (innerElementInDocument && innerElementInDocument->document() != this) {
innerElementInDocument->document().updateHoverActiveState(
- request, innerElementInDocument, hitScrollbar);
+ request, innerElementInDocument);
innerElementInDocument = innerElementInDocument->document().localOwner();
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698