Chromium Code Reviews| 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 a956cd4ee393e62f18998302b8d94965cdf65e8a..e7a6f37acb34b59b737cb6904d742321b83aba9c 100644 |
| --- a/third_party/WebKit/Source/core/frame/FrameView.cpp |
| +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp |
| @@ -1553,7 +1553,7 @@ void FrameView::didScrollTimerFired(Timer<FrameView>*) |
| } |
| } |
| -void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() |
| +void FrameView::updateLayersAndCompositingAfterScrollIfNeeded(const DoubleSize& scrollDelta) |
| { |
| // Nothing to do after scrolling if there are no fixed position elements. |
| if (!hasViewportConstrainedObjects()) |
| @@ -1561,6 +1561,14 @@ void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() |
| RefPtrWillBeRawPtr<FrameView> protect(this); |
| + // Update sticky positioned elements which scroll with the viewport. |
|
chrishtr
2015/10/06 17:08:33
Are position: sticky elements spec'ed to stick to
flackr
2015/10/07 20:38:12
They're spec'ed to stick to the viewport if no anc
|
| + for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { |
| + LayoutObject* layoutObject = viewportConstrainedObject; |
| + DeprecatedPaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer(); |
| + if (layoutObject->style()->position() == StickyPosition && layer->scrollsWithViewport()) |
| + layer->updateLayerPositionsAfterOverflowScroll(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. |
| @@ -2129,7 +2137,7 @@ void FrameView::scrollTo(const DoublePoint& newPosition) |
| m_pendingScrollDelta += scrollDelta; |
| clearScrollAnchor(); |
| - updateLayersAndCompositingAfterScrollIfNeeded(); |
| + updateLayersAndCompositingAfterScrollIfNeeded(scrollDelta); |
| scrollPositionChanged(); |
| frame().loader().client()->didChangeScrollOffset(); |
| } |
| @@ -3158,13 +3166,19 @@ int FrameView::scrollSize(ScrollbarOrientation orientation) const |
| return scrollbar->totalSize() - scrollbar->visibleSize(); |
| } |
| -void FrameView::setScrollOffset(const IntPoint& offset, ScrollType) |
| +void FrameView::setScrollOffset(const IntPoint& offset, ScrollType type) |
| { |
| + // Scrolling is triggered directly in response to events but should be |
| + // processed after compositing update. http://crbug.com/420741 |
| + DisableCompositingQueryAsserts disabler; |
|
chrishtr
2015/10/06 17:08:33
What is the code path that is now active which lea
flackr
2015/10/07 20:38:12
The stack trace is here:
#0 0x00007fdaea9281b1 in
chrishtr
2015/11/04 01:40:44
Why is the compositing data stale when setScrollOf
flackr
2015/11/25 21:03:01
We have the same disabler in PaintLayerScrollableA
|
| scrollTo(clampScrollPosition(offset)); |
| } |
| -void FrameView::setScrollOffset(const DoublePoint& offset, ScrollType) |
| +void FrameView::setScrollOffset(const DoublePoint& offset, ScrollType type) |
| { |
| + // Scrolling is triggered directly in response to events but should be |
| + // processed after compositing update. http://crbug.com/420741 |
| + DisableCompositingQueryAsserts disabler; |
|
chrishtr
2015/10/06 17:08:33
Same question here.
flackr
2015/10/07 20:38:12
Same as above.
|
| scrollTo(clampScrollPosition(offset)); |
| } |