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

Unified Diff: cc/blink/web_layer_impl.cc

Issue 2911463002: Unify the calculation of main thread offset of sticky element (Closed)
Patch Set: Bug fix 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
« no previous file with comments | « cc/blink/web_layer_impl.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/blink/web_layer_impl.cc
diff --git a/cc/blink/web_layer_impl.cc b/cc/blink/web_layer_impl.cc
index 5526a70f430a682daf21468d400d99c8d8efd263..a65ea63eb27d4f126094cdcbb8a987f66c726ebf 100644
--- a/cc/blink/web_layer_impl.cc
+++ b/cc/blink/web_layer_impl.cc
@@ -375,8 +375,6 @@ ToWebLayerStickyPositionConstraint(
web_constraint.right_offset = constraint.right_offset;
web_constraint.top_offset = constraint.top_offset;
web_constraint.bottom_offset = constraint.bottom_offset;
- web_constraint.parent_relative_sticky_box_offset =
- constraint.parent_relative_sticky_box_offset;
web_constraint.scroll_container_relative_sticky_box_rect =
constraint.scroll_container_relative_sticky_box_rect;
web_constraint.scroll_container_relative_containing_block_rect =
@@ -399,8 +397,6 @@ static cc::LayerStickyPositionConstraint ToStickyPositionConstraint(
constraint.right_offset = web_constraint.right_offset;
constraint.top_offset = web_constraint.top_offset;
constraint.bottom_offset = web_constraint.bottom_offset;
- constraint.parent_relative_sticky_box_offset =
- web_constraint.parent_relative_sticky_box_offset;
constraint.scroll_container_relative_sticky_box_rect =
web_constraint.scroll_container_relative_sticky_box_rect;
constraint.scroll_container_relative_containing_block_rect =
@@ -421,6 +417,14 @@ blink::WebLayerStickyPositionConstraint WebLayerImpl::StickyPositionConstraint()
layer_->sticky_position_constraint());
}
+void WebLayerImpl::SetOffsetForStickyPosition(const blink::WebSize& offset) {
+ layer_->SetOffsetForStickyPositionFromMainThread(offset);
+}
+
+blink::WebSize WebLayerImpl::OffsetForStickyPosition() const {
+ return layer_->offset_for_sticky_position_from_main_thread();
+}
+
void WebLayerImpl::SetScrollClient(blink::WebLayerScrollClient* scroll_client) {
if (scroll_client) {
layer_->set_did_scroll_callback(
« no previous file with comments | « cc/blink/web_layer_impl.h ('k') | cc/layers/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698