Index: third_party/WebKit/Source/core/frame/FrameView.cpp |
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp |
index 6dc9581abac44e64276b3d543581cd8684337713..665c23f07c336dfd7a9896fff59cb587ceb11416 100644 |
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp |
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp |
@@ -1556,7 +1556,7 @@ void FrameView::didScrollTimerFired(Timer<FrameView>*) |
m_frame->document()->fetcher()->updateAllImageResourcePriorities(); |
} |
-void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() |
+void FrameView::updateLayersAndCompositingAfterScrollIfNeeded(const DoubleSize& scrollDelta) |
{ |
// Nothing to do after scrolling if there are no fixed position elements. |
if (!hasViewportConstrainedObjects()) |
@@ -1564,6 +1564,14 @@ void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() |
RefPtrWillBeRawPtr<FrameView> protect(this); |
+ // Update sticky position objects which are stuck to the viewport. |
+ for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { |
chrishtr
2015/11/04 01:55:18
Shouldn't this go in PaintLayerScrollableArea? Thi
flackr
2015/11/25 20:47:52
The root frame doesn't use PaintLayerScrollableAre
chrishtr
2015/12/09 00:37:38
What about iframes?
|
+ LayoutObject* layoutObject = viewportConstrainedObject; |
+ PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer(); |
+ if (layoutObject->style()->position() == StickyPosition) |
+ layer->updateLayerPositionAfterFrameScroll(scrollDelta); |
+ } |
+ |
// If there fixed position elements, scrolling may cause compositing layers to change. |
// Update widget and layer positions after scrolling, but only if we're not inside of |
// layout. |
@@ -2114,7 +2122,7 @@ void FrameView::scrollTo(const DoublePoint& newPosition) |
m_pendingScrollDelta += scrollDelta; |
clearScrollAnchor(); |
- updateLayersAndCompositingAfterScrollIfNeeded(); |
+ updateLayersAndCompositingAfterScrollIfNeeded(scrollDelta); |
scrollPositionChanged(); |
frame().loader().client()->didChangeScrollOffset(); |
} |