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

Unified Diff: cc/layers/layer.cc

Issue 30793002: cc: Do not allow gesture-scrolling 'overflow[-{x|y}]:hidden' layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: needs-commit Created 7 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/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 15de22340069d2ca2622db4f13b00f81338ade75..80fad6a5511f689d3c45b3849c5c416872696863 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -41,6 +41,8 @@ Layer::Layer()
scrollable_(false),
should_scroll_on_main_thread_(false),
have_wheel_event_handlers_(false),
+ user_scrollable_horizontal_(true),
+ user_scrollable_vertical_(true),
anchor_point_(0.5f, 0.5f),
background_color_(0),
compositing_reasons_(kCompositingReasonUnknown),
@@ -646,6 +648,16 @@ void Layer::SetScrollable(bool scrollable) {
SetNeedsCommit();
}
+void Layer::SetUserScrollable(bool horizontal, bool vertical) {
+ DCHECK(IsPropertyChangeAllowed());
+ if (user_scrollable_horizontal_ == horizontal &&
+ user_scrollable_vertical_ == vertical)
+ return;
+ user_scrollable_horizontal_ = horizontal;
+ user_scrollable_vertical_ = vertical;
+ SetNeedsCommit();
+}
+
void Layer::SetShouldScrollOnMainThread(bool should_scroll_on_main_thread) {
DCHECK(IsPropertyChangeAllowed());
if (should_scroll_on_main_thread_ == should_scroll_on_main_thread)
@@ -833,6 +845,8 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
DCHECK(!(TransformIsAnimating() && layer->TransformIsAnimatingOnImplOnly()));
layer->SetScrollable(scrollable_);
+ layer->set_user_scrollable_horizontal(user_scrollable_horizontal_);
+ layer->set_user_scrollable_vertical(user_scrollable_vertical_);
layer->SetMaxScrollOffset(max_scroll_offset_);
LayerImpl* scroll_parent = NULL;
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698