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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2422353002: Iframe/div MD scrollbars get idle when mouse leaves the nested elements. (Closed)
Patch Set: Created 4 years, 2 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_host_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_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index d47f504871741c890f5daf7280c13c7412cf7e2e..28eba769b00d0bdb3fbd922dcfd5ea7677f221ad 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -209,6 +209,7 @@ LayerTreeHostImpl::LayerTreeHostImpl(
wheel_scrolling_(false),
scroll_affects_scroll_handler_(false),
scroll_layer_id_when_mouse_over_scrollbar_(Layer::INVALID_ID),
+ scroll_layer_id_when_mouse_near_scrollbar_(Layer::INVALID_ID),
captured_scrollbar_layer_id_(Layer::INVALID_ID),
tile_priorities_dirty_(false),
settings_(settings),
@@ -3256,9 +3257,17 @@ void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
if (scroll_on_main_thread || !scroll_layer_impl)
return;
- ScrollbarAnimationController* animation_controller =
+ if (scroll_layer_impl->id() != scroll_layer_id_when_mouse_near_scrollbar_) {
+ ScrollbarAnimationController* old_animation_controller =
+ ScrollbarAnimationControllerForId(
bokan 2016/10/18 15:44:35 Hmm...too much of this logic is starting to creep
sahel 2016/10/19 21:29:17 Done.
+ scroll_layer_id_when_mouse_near_scrollbar_);
+ if (old_animation_controller)
+ old_animation_controller->DidMouseMoveOffScrollbar();
+ }
+
+ ScrollbarAnimationController* new_animation_controller =
ScrollbarAnimationControllerForId(scroll_layer_impl->id());
- if (!animation_controller)
+ if (!new_animation_controller)
return;
float distance_to_scrollbar = std::numeric_limits<float>::max();
@@ -3268,8 +3277,10 @@ void LayerTreeHostImpl::MouseMoveAt(const gfx::Point& viewport_point) {
std::min(distance_to_scrollbar,
DeviceSpaceDistanceToLayer(device_viewport_point, scrollbar));
- animation_controller->DidMouseMoveNear(distance_to_scrollbar /
- active_tree_->device_scale_factor());
+ new_animation_controller->DidMouseMoveNear(
+ distance_to_scrollbar / active_tree_->device_scale_factor());
+ if (new_animation_controller->MouseIsNearScrollbar())
+ scroll_layer_id_when_mouse_near_scrollbar_ = scroll_layer_impl->id();
}
void LayerTreeHostImpl::HandleMouseOverScrollbar(LayerImpl* layer_impl) {
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698