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

Unified Diff: cc/layers/layer.cc

Issue 2769793002: Implement CSS: scroll-boundary-behavior (Closed)
Patch Set: Add documentation Created 3 years, 5 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_test_properties.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 d96b381e02e54fe65aec55039539c7c0a3ac9a18..1efeb5b9b18446cee9d411e5acc3555549329191 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -65,7 +65,9 @@ Layer::Inputs::Inputs(int layer_id)
clip_parent(nullptr),
has_will_change_transform_hint(false),
hide_layer_and_subtree(false),
- client(nullptr) {}
+ client(nullptr),
+ scroll_boundary_behavior(
+ ScrollBoundaryBehavior::kScrollBoundaryBehaviorTypeAuto) {}
Layer::Inputs::~Inputs() {}
@@ -306,6 +308,25 @@ void Layer::SetBounds(const gfx::Size& size) {
SetNeedsCommit();
}
+void Layer::SetScrollBoundaryBehavior(const ScrollBoundaryBehavior& behavior) {
+ DCHECK(IsPropertyChangeAllowed());
+ if (scroll_boundary_behavior() == behavior)
+ return;
+ inputs_.scroll_boundary_behavior = behavior;
+ if (!layer_tree_host_)
+ return;
+
+ if (scrollable()) {
+ auto& scroll_tree = layer_tree_host_->property_trees()->scroll_tree;
+ if (auto* scroll_node = scroll_tree.Node(scroll_tree_index_))
+ scroll_node->scroll_boundary_behavior = behavior;
+ else
+ SetPropertyTreesNeedRebuild();
+ }
+
+ SetNeedsCommit();
+}
+
Layer* Layer::RootLayer() {
Layer* layer = this;
while (layer->parent())
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl_test_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698