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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 1878323002: cc: Scroll on main when possible incorrect hit testing hits scrollbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make sure the unit test fails without the patch Created 4 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
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index cc096f827806aede1c62c63048a4afdb797c7cd4..f2c6a83f03049f49c2499b8c42e5eb855cb64e60 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -1755,8 +1755,9 @@ static void FindClosestMatchingLayer(const gfx::PointF& screen_space_point,
}
}
-static bool ScrollsAnyDrawnRenderSurfaceLayerListMember(LayerImpl* layer) {
- if (!layer->scrollable())
+static bool ScrollsOrScrollbarAnyDrawnRenderSurfaceLayerListMember(
+ LayerImpl* layer) {
+ if (!layer->scrollable() && !layer->ToScrollbarLayer())
return false;
if (layer->layer_or_descendant_is_drawn())
return true;
@@ -1772,25 +1773,27 @@ static bool ScrollsAnyDrawnRenderSurfaceLayerListMember(LayerImpl* layer) {
return false;
}
-struct FindScrollingLayerFunctor {
+struct FindScrollingLayerOrScrollbarLayerFunctor {
bool operator()(LayerImpl* layer) const {
- return ScrollsAnyDrawnRenderSurfaceLayerListMember(layer);
+ return ScrollsOrScrollbarAnyDrawnRenderSurfaceLayerListMember(layer);
}
};
-LayerImpl* LayerTreeImpl::FindFirstScrollingLayerThatIsHitByPoint(
+LayerImpl*
+LayerTreeImpl::FindFirstScrollingLayerOrScrollbarLayerThatIsHitByPoint(
const gfx::PointF& screen_space_point) {
FindClosestMatchingLayerState state;
- FindClosestMatchingLayer(
- screen_space_point, root_layer(), FindScrollingLayerFunctor(),
- property_trees_.transform_tree, property_trees_.clip_tree, &state);
+ FindClosestMatchingLayer(screen_space_point, root_layer(),
+ FindScrollingLayerOrScrollbarLayerFunctor(),
+ property_trees_.transform_tree,
+ property_trees_.clip_tree, &state);
return state.closest_match;
}
struct HitTestVisibleScrollableOrTouchableFunctor {
bool operator()(LayerImpl* layer) const {
return layer->IsDrawnRenderSurfaceLayerListMember() ||
- ScrollsAnyDrawnRenderSurfaceLayerListMember(layer) ||
+ ScrollsOrScrollbarAnyDrawnRenderSurfaceLayerListMember(layer) ||
!layer->touch_event_handler_region().IsEmpty();
}
};
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698