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

Unified Diff: cc/layers/layer_impl.cc

Issue 2769793002: Implement CSS: scroll-boundary-behavior (Closed)
Patch Set: update the tests Created 3 years, 6 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
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 6e45fd3b02b62a6a08daa40a83f89129e0b55fc9..7e5439c5c7e844427c5ba2384d3374f254895ed2 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -80,7 +80,9 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id)
scrollbars_hidden_(false),
needs_show_scrollbars_(false),
raster_even_if_not_drawn_(false),
- has_transform_node_(false) {
+ has_transform_node_(false),
+ scroll_boundary_behavior_(
+ ScrollBoundaryBehavior::kScrollBoundaryBehaviorTypeAuto) {
DCHECK_GT(layer_id_, 0);
DCHECK(layer_tree_impl_);
@@ -337,6 +339,7 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
if (scrollable_)
layer->SetScrollable(scroll_container_bounds_);
layer->SetMutableProperties(mutable_properties_);
+ layer->SetScrollBoundaryBehavior(scroll_boundary_behavior_);
// If the main thread commits multiple times before the impl thread actually
// draws, then damage tracking will become incorrect if we simply clobber the
@@ -763,6 +766,14 @@ gfx::Vector2dF LayerImpl::ClampScrollToMaxScrollOffset() {
return delta;
}
+void LayerImpl::SetScrollBoundaryBehavior(
+ const ScrollBoundaryBehavior& behavior) {
+ if (scroll_boundary_behavior_ == behavior)
+ return;
+ scroll_boundary_behavior_ = behavior;
+ NoteLayerPropertyChanged();
+}
+
void LayerImpl::SetNeedsPushProperties() {
// There's no need to push layer properties on the active tree.
if (!needs_push_properties_ && !layer_tree_impl()->IsActiveTree()) {

Powered by Google App Engine
This is Rietveld 408576698