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

Unified Diff: cc/layers/layer_sticky_position_constraint.cc

Issue 2733633002: Handle nested position:sticky elements correctly (compositor) (Closed)
Patch Set: Addressed the easier reviewer comments. Created 3 years, 9 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_sticky_position_constraint.cc
diff --git a/cc/layers/layer_sticky_position_constraint.cc b/cc/layers/layer_sticky_position_constraint.cc
index 79414d6a8775daeb4d3a0a67a9b4717cdb61432e..bb7478734cee8db4abbb1ab0540e27be515fbd0b 100644
--- a/cc/layers/layer_sticky_position_constraint.cc
+++ b/cc/layers/layer_sticky_position_constraint.cc
@@ -15,7 +15,9 @@ LayerStickyPositionConstraint::LayerStickyPositionConstraint()
left_offset(0.f),
right_offset(0.f),
top_offset(0.f),
- bottom_offset(0.f) {}
+ bottom_offset(0.f),
+ nearest_layer_shifting_sticky_box(nullptr),
+ nearest_layer_shifting_containing_block(nullptr) {}
LayerStickyPositionConstraint::LayerStickyPositionConstraint(
const LayerStickyPositionConstraint& other)
@@ -33,7 +35,15 @@ LayerStickyPositionConstraint::LayerStickyPositionConstraint(
scroll_container_relative_sticky_box_rect(
other.scroll_container_relative_sticky_box_rect),
scroll_container_relative_containing_block_rect(
- other.scroll_container_relative_containing_block_rect) {}
+ other.scroll_container_relative_containing_block_rect),
+ nearest_layer_shifting_sticky_box(
+ other.nearest_layer_shifting_sticky_box),
+ nearest_layer_shifting_containing_block(
+ other.nearest_layer_shifting_containing_block),
+ total_sticky_box_sticky_offset(other.total_sticky_box_sticky_offset),
+ total_containing_block_sticky_offset(
+ other.total_containing_block_sticky_offset),
+ local_sticky_offset(other.local_sticky_offset) {}
bool LayerStickyPositionConstraint::operator==(
const LayerStickyPositionConstraint& other) const {
@@ -52,7 +62,16 @@ bool LayerStickyPositionConstraint::operator==(
scroll_container_relative_sticky_box_rect ==
other.scroll_container_relative_sticky_box_rect &&
scroll_container_relative_containing_block_rect ==
- other.scroll_container_relative_containing_block_rect;
+ other.scroll_container_relative_containing_block_rect &&
+ nearest_layer_shifting_sticky_box ==
+ other.nearest_layer_shifting_sticky_box &&
+ nearest_layer_shifting_containing_block ==
+ other.nearest_layer_shifting_containing_block &&
+ total_sticky_box_sticky_offset ==
+ other.total_sticky_box_sticky_offset &&
+ total_containing_block_sticky_offset ==
+ other.total_containing_block_sticky_offset &&
+ local_sticky_offset == other.local_sticky_offset;
}
bool LayerStickyPositionConstraint::operator!=(

Powered by Google App Engine
This is Rietveld 408576698