Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Side by Side Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2020103002: Fix sticky constraints and update sticky layer positions recursively after scroll. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master and add comment explaining container content rect. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 1615
1616 setLayoutSizeInternal(size); 1616 setLayoutSizeInternal(size);
1617 } 1617 }
1618 1618
1619 void FrameView::didScrollTimerFired(Timer<FrameView>*) 1619 void FrameView::didScrollTimerFired(Timer<FrameView>*)
1620 { 1620 {
1621 if (m_frame->document() && !m_frame->document()->layoutViewItem().isNull()) 1621 if (m_frame->document() && !m_frame->document()->layoutViewItem().isNull())
1622 m_frame->document()->fetcher()->updateAllImageResourcePriorities(); 1622 m_frame->document()->fetcher()->updateAllImageResourcePriorities();
1623 } 1623 }
1624 1624
1625 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() 1625 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded(const DoubleSize& scrollDelta)
1626 { 1626 {
1627 // Nothing to do after scrolling if there are no fixed position elements. 1627 // Nothing to do after scrolling if there are no fixed position elements.
1628 if (!hasViewportConstrainedObjects()) 1628 if (!hasViewportConstrainedObjects())
1629 return; 1629 return;
1630 1630
1631 // Update sticky position objects which are stuck to the viewport. 1631 // Update sticky position objects which are stuck to the viewport.
1632 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) { 1632 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) {
1633 LayoutObject* layoutObject = viewportConstrainedObject; 1633 LayoutObject* layoutObject = viewportConstrainedObject;
1634 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer(); 1634 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer();
1635 if (layoutObject->style()->position() == StickyPosition) 1635 if (layoutObject->style()->position() == StickyPosition) {
1636 layer->updateLayerPosition(); 1636 // TODO(skobes): Resolve circular dependency between scroll offset a nd
1637 // compositing state, and remove this disabler. https://crbug.com/42 0741
1638 DisableCompositingQueryAsserts disabler;
1639 layer->updateLayerPositionsAfterOverflowScroll(scrollDelta);
1640 }
1637 } 1641 }
1638 1642
1639 // If there fixed position elements, scrolling may cause compositing layers to change. 1643 // If there fixed position elements, scrolling may cause compositing layers to change.
1640 // Update widget and layer positions after scrolling, but only if we're not inside of 1644 // Update widget and layer positions after scrolling, but only if we're not inside of
1641 // layout. 1645 // layout.
1642 if (!m_nestedLayoutCount) { 1646 if (!m_nestedLayoutCount) {
1643 updateWidgetGeometries(); 1647 updateWidgetGeometries();
1644 LayoutViewItem layoutViewItem = this->layoutViewItem(); 1648 LayoutViewItem layoutViewItem = this->layoutViewItem();
1645 if (!layoutViewItem.isNull()) 1649 if (!layoutViewItem.isNull())
1646 layoutViewItem.layer()->setNeedsCompositingInputsUpdate(); 1650 layoutViewItem.layer()->setNeedsCompositingInputsUpdate();
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
3250 // Don't scroll the FrameView! 3254 // Don't scroll the FrameView!
3251 ASSERT_NOT_REACHED(); 3255 ASSERT_NOT_REACHED();
3252 } 3256 }
3253 3257
3254 m_scrollPosition = newPosition; 3258 m_scrollPosition = newPosition;
3255 3259
3256 if (!scrollbarsSuppressed()) 3260 if (!scrollbarsSuppressed())
3257 m_pendingScrollDelta += scrollDelta; 3261 m_pendingScrollDelta += scrollDelta;
3258 3262
3259 clearFragmentAnchor(); 3263 clearFragmentAnchor();
3260 updateLayersAndCompositingAfterScrollIfNeeded(); 3264 updateLayersAndCompositingAfterScrollIfNeeded(scrollDelta);
3261 3265
3262 Document* document = m_frame->document(); 3266 Document* document = m_frame->document();
3263 document->enqueueScrollEventForNode(document); 3267 document->enqueueScrollEventForNode(document);
3264 3268
3265 m_frame->eventHandler().dispatchFakeMouseMoveEventSoon(); 3269 m_frame->eventHandler().dispatchFakeMouseMoveEventSoon();
3266 Page* page = frame().page(); 3270 Page* page = frame().page();
3267 if (page) 3271 if (page)
3268 page->chromeClient().clearToolTip(); 3272 page->chromeClient().clearToolTip();
3269 3273
3270 LayoutViewItem layoutViewItem = document->layoutViewItem(); 3274 LayoutViewItem layoutViewItem = document->layoutViewItem();
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
4148 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling); 4152 return m_subtreeThrottled || (m_hiddenForThrottling && m_crossOriginForThrot tling);
4149 } 4153 }
4150 4154
4151 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4155 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4152 { 4156 {
4153 ASSERT(!layoutViewItem().isNull()); 4157 ASSERT(!layoutViewItem().isNull());
4154 return *layoutView(); 4158 return *layoutView();
4155 } 4159 }
4156 4160
4157 } // namespace blink 4161 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698