Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| index abd711d097e33fed7cec2f2ad8f59fe7989654c9..ecefb3c41c7b6803ed727d1d51601c0286d3e04f 100644 |
| --- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| +++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp |
| @@ -1128,16 +1128,13 @@ void CompositedLayerMapping::UpdateMainGraphicsLayerGeometry( |
| const IntRect& relative_compositing_bounds, |
| const IntRect& local_compositing_bounds, |
| const IntPoint& graphics_layer_parent_location) { |
| - graphics_layer_->SetPosition(FloatPoint( |
| - relative_compositing_bounds.Location() - graphics_layer_parent_location)); |
| - graphics_layer_->SetOffsetFromLayoutObject( |
| - ToIntSize(local_compositing_bounds.Location())); |
| // 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. |
| - FloatSize main_thread_sticky_offset; |
| - if (GetLayoutObject().Style()->GetPosition() == EPosition::kSticky) { |
| + // composited layer. This information is used to shift layer position to |
| + // keep the element stuck under compositor scrolling. |
| + FloatSize offset_for_sticky_position; |
| + if (GetLayoutObject().Style()->GetPosition() == EPosition::kSticky && |
|
flackr
2017/06/08 18:56:19
This definitely needs a comment at a minimum, alth
yigu
2017/06/08 23:30:03
Done.
|
| + (owning_layer_.AncestorOverflowLayer()->IsRootLayer() || |
| + owning_layer_.AncestorOverflowLayer()->NeedsCompositedScrolling())) { |
|
flackr
2017/06/08 22:26:55
chrishtr, trchen, I'm wondering if it's safe to tr
chrishtr
2017/06/08 22:38:40
Yes, it is safe. Paint layer compositor works in t
|
| const StickyConstraintsMap& constraints_map = |
| owning_layer_.AncestorOverflowLayer() |
| ->GetScrollableArea() |
| @@ -1145,11 +1142,15 @@ void CompositedLayerMapping::UpdateMainGraphicsLayerGeometry( |
| const StickyPositionScrollingConstraints& constraints = |
| constraints_map.at(&owning_layer_); |
| - main_thread_sticky_offset = |
| + offset_for_sticky_position = |
| constraints.GetOffsetForStickyPosition(constraints_map); |
| } |
| - graphics_layer_->SetOffsetForStickyPosition( |
| - RoundedIntSize(main_thread_sticky_offset)); |
| + graphics_layer_->SetPosition( |
| + FloatPoint(relative_compositing_bounds.Location() - |
| + graphics_layer_parent_location) - |
| + offset_for_sticky_position); |
| + graphics_layer_->SetOffsetFromLayoutObject( |
| + ToIntSize(local_compositing_bounds.Location())); |
| FloatSize old_size = graphics_layer_->Size(); |
| const FloatSize contents_size(relative_compositing_bounds.Size()); |