Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/LayoutView.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp |
| index 374293e898c154a038231f87d6e7e1010b63b406..a612f0150b93e72689469b6ca86bf1dc8646b757 100644 |
| --- a/third_party/WebKit/Source/core/layout/LayoutView.cpp |
| +++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp |
| @@ -155,6 +155,23 @@ bool LayoutView::hitTestNoLifecycleUpdate(HitTestResult& result) { |
| frameView()->scrollbarAtFramePoint(framePoint)) |
| result.setScrollbar(frameScrollbar); |
| + // If hitTestResult include scrollbar, innerNode should be the parent of the |
| + // scrollbar. |
| + if (result.scrollbar()) { |
| + // Clear innerNode if hitTest if we hit a scrollbar whose scrollable area |
| + // isn't associated with a LayoutBox we aren't hitting some random element |
| + // below too. |
|
bokan
2017/04/04 15:18:01
Nit: "Clear innerNode if hitTest if we hit..." ->
|
| + result.setInnerNode(nullptr); |
| + result.setURLElement(nullptr); |
| + ScrollableArea* scrollableArea = result.scrollbar()->getScrollableArea(); |
| + if (scrollableArea && scrollableArea->layoutBox() && |
| + scrollableArea->layoutBox()->node()) { |
| + Node* node = scrollableArea->layoutBox()->node(); |
| + result.setInnerNode(node); |
| + result.setURLElement(node->enclosingLinkEventParentOrSelf()); |
| + } |
| + } |
| + |
| if (hitLayer) |
| m_hitTestCache->addCachedResult(result, domTreeVersion); |
| } |