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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 910373002: [Android] Disable pull-to-refresh with overflow:hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass overflow:hidden via metadata Created 5 years, 10 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/output/compositor_frame_metadata.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | 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 86401a7dca992c469fca2e80606a9aeac99ff513..7343cb3475a3e8490a3933c9a6327fe9bff464b7 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1446,6 +1446,16 @@ CompositorFrameMetadata LayerTreeHostImpl::MakeCompositorFrameMetadata() const {
active_tree_->GetViewportSelection(&metadata.selection_start,
&metadata.selection_end);
+ LayerImpl* root_layer_for_overflow = OuterViewportScrollLayer()
+ ? OuterViewportScrollLayer()
+ : InnerViewportScrollLayer();
+ if (root_layer_for_overflow) {
+ metadata.root_overflow_x_hidden =
+ !root_layer_for_overflow->user_scrollable_horizontal();
+ metadata.root_overflow_y_hidden =
+ !root_layer_for_overflow->user_scrollable_vertical();
+ }
+
if (!InnerViewportScrollLayer())
return metadata;
@@ -2664,13 +2674,26 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollBy(
unused_root_delta.set_x(0.0f);
if (std::abs(unused_root_delta.y()) < kEpsilon)
unused_root_delta.set_y(0.0f);
+
+ // If there is unconsumed scroll after application to the viewport, and
+ // the (outer) viewport layer is explicitly marked unscrollable, suppress
+ // any overscroll, preventing bubbling to UI layers.
+ const LayerImpl* layer_for_user_scrollable_testing =
jdduke (slow) 2015/02/11 22:22:56 Oops, I'll go ahead and revert this change, it's n
+ OuterViewportScrollLayer() ? OuterViewportScrollLayer() : layer_impl;
+ if (unused_root_delta.x() &&
+ !layer_for_user_scrollable_testing->user_scrollable_horizontal()) {
+ unused_root_delta.set_x(0);
+ }
+ if (unused_root_delta.y() &&
+ !layer_for_user_scrollable_testing->user_scrollable_vertical()) {
+ unused_root_delta.set_y(0);
+ }
+
// Disable overscroll on axes which is impossible to scroll.
if (settings_.report_overscroll_only_for_scrollable_axes) {
- if (std::abs(active_tree_->TotalMaxScrollOffset().x()) <= kEpsilon ||
- !layer_impl->user_scrollable_horizontal())
+ if (std::abs(active_tree_->TotalMaxScrollOffset().x()) <= kEpsilon)
unused_root_delta.set_x(0.0f);
- if (std::abs(active_tree_->TotalMaxScrollOffset().y()) <= kEpsilon ||
- !layer_impl->user_scrollable_vertical())
+ if (std::abs(active_tree_->TotalMaxScrollOffset().y()) <= kEpsilon)
unused_root_delta.set_y(0.0f);
}
}
« no previous file with comments | « cc/output/compositor_frame_metadata.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698