Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp |
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
index 5d76895c46da812a4a79674bbfc21deb8e71769a..16daa7935f716147c8c63a7253c9b2c7d9f603f3 100644 |
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp |
@@ -842,6 +842,17 @@ void PaintLayer::UpdateLayerPosition() { |
if (rare_data_ || !new_offset.IsZero()) |
EnsureRareData().offset_for_in_flow_position = new_offset; |
local_point.Move(new_offset); |
+ |
+ // Find the layout offset of the unshifted sticky box within its parent |
+ // composited layer. This information is used by the compositor side to |
+ // compute the additional offset required to keep the element stuck under |
+ // compositor scrolling. |
+ if (GetLayoutObject().Style()->GetPosition() == EPosition::kSticky && |
+ GetCompositedLayerMapping()) { |
+ GetCompositedLayerMapping() |
+ ->MainGraphicsLayer() |
+ ->SetStickyMainThreadOffset(RoundedIntSize(new_offset)); |
flackr
2017/06/01 19:01:47
I don't think this is the right place to set the s
yigu
2017/06/01 19:28:40
Done.
|
+ } |
} else if (rare_data_) { |
rare_data_->offset_for_in_flow_position = LayoutSize(); |
} |