Index: cc/trees/property_tree_builder.cc |
diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc |
index be8ad79344b1b7ebff046a8b15ce3b57a02c34cc..4cbdddf079299c60d1a85b7a9973299edda2959c 100644 |
--- a/cc/trees/property_tree_builder.cc |
+++ b/cc/trees/property_tree_builder.cc |
@@ -490,6 +490,7 @@ bool AddTransformNodeIfNeeded( |
layer == data_from_ancestor.overscroll_elasticity_layer; |
const bool is_scrollable = layer->scrollable(); |
const bool is_fixed = PositionConstraint(layer).is_fixed_position(); |
+ const bool is_sticky = layer->sticky_position_constraint().is_sticky; |
const bool has_significant_transform = |
!Transform(layer).IsIdentityOr2DTranslation(); |
@@ -524,7 +525,7 @@ bool AddTransformNodeIfNeeded( |
has_any_transform_animation || has_surface || is_fixed || |
is_page_scale_layer || is_overscroll_elasticity_layer || |
has_proxied_transform_related_property || |
- scroll_child_has_different_target || |
+ scroll_child_has_different_target || is_sticky || |
is_at_boundary_of_3d_rendering_context; |
LayerType* transform_parent = GetTransformParent(data_from_ancestor, layer); |
@@ -691,6 +692,19 @@ bool AddTransformNodeIfNeeded( |
node->local = Transform(layer); |
node->update_pre_local_transform(TransformOrigin(layer)); |
+ if (layer->sticky_position_constraint().is_sticky) { |
+ StickyPositionNodeData* sticky_data = |
+ data_for_children->property_trees->transform_tree.StickyPositionData( |
+ node->id); |
+ sticky_data->constraints = layer->sticky_position_constraint(); |
+ sticky_data->scroll_ancestor = GetScrollParentId(data_from_ancestor, layer); |
+ sticky_data->main_thread_offset = |
+ layer->position().OffsetFromOrigin() - |
+ sticky_data->constraints.absolute_sticky_box_rect.OffsetFromOrigin(); |
+ } else { |
+ data_for_children->property_trees->transform_tree.SetNotSticky(node->id); |
+ } |
+ |
node->needs_local_transform_update = true; |
data_from_ancestor.property_trees->transform_tree.UpdateTransforms(node->id); |