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

Unified Diff: cc/layers/layer_sticky_position_constraint.cc

Issue 2401903002: Compute and include the offset of the sticky box to its enclosing composited layer. (Closed)
Patch Set: Merge with master and fix long line. Created 4 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_sticky_position_constraint.h ('k') | cc/proto/layer_sticky_position_constraint.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_sticky_position_constraint.cc
diff --git a/cc/layers/layer_sticky_position_constraint.cc b/cc/layers/layer_sticky_position_constraint.cc
index 0fc0af84a8e890436cdb68c3a934637253f63038..2b6b33295db6985762a895ea77c22c5f25d74ebd 100644
--- a/cc/layers/layer_sticky_position_constraint.cc
+++ b/cc/layers/layer_sticky_position_constraint.cc
@@ -30,6 +30,8 @@ LayerStickyPositionConstraint::LayerStickyPositionConstraint(
right_offset(other.right_offset),
top_offset(other.top_offset),
bottom_offset(other.bottom_offset),
+ parent_relative_sticky_box_offset(
+ other.parent_relative_sticky_box_offset),
scroll_container_relative_sticky_box_rect(
other.scroll_container_relative_sticky_box_rect),
scroll_container_relative_containing_block_rect(
@@ -46,6 +48,8 @@ void LayerStickyPositionConstraint::ToProtobuf(
proto->set_right_offset(right_offset);
proto->set_top_offset(top_offset);
proto->set_bottom_offset(bottom_offset);
+ PointToProto(parent_relative_sticky_box_offset,
+ proto->mutable_parent_relative_sticky_box_offset());
RectToProto(scroll_container_relative_sticky_box_rect,
proto->mutable_scroll_container_relative_sticky_box_rect());
RectToProto(scroll_container_relative_containing_block_rect,
@@ -63,6 +67,8 @@ void LayerStickyPositionConstraint::FromProtobuf(
right_offset = proto.right_offset();
top_offset = proto.top_offset();
bottom_offset = proto.bottom_offset();
+ parent_relative_sticky_box_offset =
+ ProtoToPoint(proto.parent_relative_sticky_box_offset());
scroll_container_relative_sticky_box_rect =
ProtoToRect(proto.scroll_container_relative_sticky_box_rect());
scroll_container_relative_containing_block_rect =
@@ -81,6 +87,8 @@ bool LayerStickyPositionConstraint::operator==(
left_offset == other.left_offset &&
right_offset == other.right_offset && top_offset == other.top_offset &&
bottom_offset == other.bottom_offset &&
+ parent_relative_sticky_box_offset ==
+ other.parent_relative_sticky_box_offset &&
scroll_container_relative_sticky_box_rect ==
other.scroll_container_relative_sticky_box_rect &&
scroll_container_relative_containing_block_rect ==
« no previous file with comments | « cc/layers/layer_sticky_position_constraint.h ('k') | cc/proto/layer_sticky_position_constraint.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698