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

Unified Diff: cc/debug/debug_rect_history.cc

Issue 1816083002: Re-land fix display of wheel event listeners on a page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/debug/debug_rect_history.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/debug_rect_history.cc
diff --git a/cc/debug/debug_rect_history.cc b/cc/debug/debug_rect_history.cc
index 80c5838321e70d187abaf1f6b7fbe57b5effd4fb..cc8d12363b1d339afe60882cfe9ca96e20768429 100644
--- a/cc/debug/debug_rect_history.cc
+++ b/cc/debug/debug_rect_history.cc
@@ -174,26 +174,26 @@ void DebugRectHistory::SaveTouchEventHandlerRectsCallback(LayerImpl* layer) {
}
}
-void DebugRectHistory::SaveWheelEventHandlerRects(LayerImpl* layer) {
- LayerTreeHostCommon::CallFunctionForSubtree(layer, [this](LayerImpl* layer) {
- SaveWheelEventHandlerRectsCallback(layer);
- });
-}
-
-void DebugRectHistory::SaveWheelEventHandlerRectsCallback(LayerImpl* layer) {
+void DebugRectHistory::SaveWheelEventHandlerRects(LayerImpl* root_layer) {
EventListenerProperties event_properties =
- layer->layer_tree_impl()->event_listener_properties(
+ root_layer->layer_tree_impl()->event_listener_properties(
EventListenerClass::kMouseWheel);
if (event_properties == EventListenerProperties::kNone ||
- (layer->layer_tree_impl()->settings().use_mouse_wheel_gestures &&
+ (root_layer->layer_tree_impl()->settings().use_mouse_wheel_gestures &&
event_properties == EventListenerProperties::kPassive)) {
return;
}
- debug_rects_.push_back(
- DebugRect(WHEEL_EVENT_HANDLER_RECT_TYPE,
- MathUtil::MapEnclosingClippedRect(layer->ScreenSpaceTransform(),
- gfx::Rect(layer->bounds()))));
+ // Since the wheel event handlers property is on the entire layer tree just
+ // mark inner viewport if have listeners.
+ LayerImpl* inner_viewport =
+ root_layer->layer_tree_impl()->InnerViewportScrollLayer();
+ if (!inner_viewport)
+ return;
+ debug_rects_.push_back(DebugRect(
+ WHEEL_EVENT_HANDLER_RECT_TYPE,
+ MathUtil::MapEnclosingClippedRect(inner_viewport->ScreenSpaceTransform(),
+ gfx::Rect(inner_viewport->bounds()))));
}
void DebugRectHistory::SaveScrollEventHandlerRects(LayerImpl* layer) {
« no previous file with comments | « cc/debug/debug_rect_history.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698