Chromium Code Reviews| Index: third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.cpp |
| diff --git a/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.cpp b/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.cpp |
| index f099cdce40417819ed11a11f133cdf54b503a75f..76d5b67ae70c2cbe3db811296d95ee63ffa8e84c 100644 |
| --- a/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.cpp |
| +++ b/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.cpp |
| @@ -3,6 +3,7 @@ |
| // found in the LICENSE file. |
| #include "core/page/scrolling/StickyPositionScrollingConstraints.h" |
| +#include "core/paint/PaintLayer.h" |
| namespace blink { |
| @@ -88,4 +89,18 @@ FloatSize StickyPositionScrollingConstraints::ComputeStickyOffset( |
| return sticky_offset; |
| } |
| +FloatSize StickyPositionScrollingConstraints::ComputeMainThreadStickyOffset( |
| + const PaintLayer& ancestor_overflow_layer) const { |
|
flackr
2017/06/02 15:33:58
Instead of passing in the ancestor_overflow_layer
yigu
2017/06/02 17:59:56
Done.
|
| + FloatSize nearest_sticky_box_shifting_sticky_box_constraints_offset; |
| + if (nearest_sticky_box_shifting_sticky_box_) { |
| + nearest_sticky_box_shifting_sticky_box_constraints_offset = |
| + ancestor_overflow_layer.GetScrollableArea() |
| + ->GetStickyConstraintsMap() |
| + .at(nearest_sticky_box_shifting_sticky_box_->Layer()) |
| + .GetTotalStickyBoxStickyOffset(); |
| + } |
| + return total_sticky_box_sticky_offset_ - |
| + nearest_sticky_box_shifting_sticky_box_constraints_offset; |
| +} |
| + |
| } // namespace blink |