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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutView.cpp

Issue 2784313002: Change hittest node to be scrollbar's parent when hittest include a scrollbar (Closed)
Patch Set: fix tests and add test 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // Layer::hitTestOverflowControls, so we need to test FrameView scrollbars 148 // Layer::hitTestOverflowControls, so we need to test FrameView scrollbars
149 // separately here. Note that it's important we do this after the hit test 149 // separately here. Note that it's important we do this after the hit test
150 // above, because that may overwrite the entire HitTestResult when it finds 150 // above, because that may overwrite the entire HitTestResult when it finds
151 // a hit. 151 // a hit.
152 IntPoint framePoint = 152 IntPoint framePoint =
153 frameView()->contentsToFrame(result.hitTestLocation().roundedPoint()); 153 frameView()->contentsToFrame(result.hitTestLocation().roundedPoint());
154 if (Scrollbar* frameScrollbar = 154 if (Scrollbar* frameScrollbar =
155 frameView()->scrollbarAtFramePoint(framePoint)) 155 frameView()->scrollbarAtFramePoint(framePoint))
156 result.setScrollbar(frameScrollbar); 156 result.setScrollbar(frameScrollbar);
157 157
158 // If hitTestResult include scrollbar, innerNode should be the parent of the
159 // scrollbar.
160 if (result.scrollbar()) {
161 ScrollableArea* scrollableArea = result.scrollbar()->getScrollableArea();
bokan 2017/03/31 20:07:00 We should probably clear the innerNode first. That
162 if (scrollableArea && scrollableArea->layoutBox() &&
163 scrollableArea->layoutBox()->node()) {
164 Node* node = scrollableArea->layoutBox()->node();
165 result.setInnerNode(node);
166 result.setURLElement(node->enclosingLinkEventParentOrSelf());
mustaq 2017/03/31 16:57:48 Please add a comment for |HitTestResult.m_innerURL
167 }
168 }
169
158 if (hitLayer) 170 if (hitLayer)
159 m_hitTestCache->addCachedResult(result, domTreeVersion); 171 m_hitTestCache->addCachedResult(result, domTreeVersion);
160 } 172 }
161 173
162 TRACE_EVENT_END1( 174 TRACE_EVENT_END1(
163 "blink,devtools.timeline", "HitTest", "endData", 175 "blink,devtools.timeline", "HitTest", "endData",
164 InspectorHitTestEvent::endData(result.hitTestRequest(), 176 InspectorHitTestEvent::endData(result.hitTestRequest(),
165 result.hitTestLocation(), result)); 177 result.hitTestLocation(), result));
166 return hitLayer; 178 return hitLayer;
167 } 179 }
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 bool LayoutView::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { 1088 bool LayoutView::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const {
1077 // Frame scroll corner is painted using LayoutView as the display item client. 1089 // Frame scroll corner is painted using LayoutView as the display item client.
1078 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() && 1090 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() &&
1079 (frameView()->horizontalScrollbar() || frameView()->verticalScrollbar())) 1091 (frameView()->horizontalScrollbar() || frameView()->verticalScrollbar()))
1080 return false; 1092 return false;
1081 1093
1082 return LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); 1094 return LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize();
1083 } 1095 }
1084 1096
1085 } // namespace blink 1097 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698