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

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

Issue 1308273010: Adapt and reland old position sticky implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove redundant invalidation in LayoutBlock::tryLayoutDoingPositionedMovementOnly Created 4 years, 9 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 , m_inSynchronousPostLayout(false) 128 , m_inSynchronousPostLayout(false)
129 , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired) 129 , m_postLayoutTasksTimer(this, &FrameView::postLayoutTimerFired)
130 , m_updateWidgetsTimer(this, &FrameView::updateWidgetsTimerFired) 130 , m_updateWidgetsTimer(this, &FrameView::updateWidgetsTimerFired)
131 , m_renderThrottlingObserverNotificationFactory(CancellableTaskFactory::crea te(this, &FrameView::notifyRenderThrottlingObservers)) 131 , m_renderThrottlingObserverNotificationFactory(CancellableTaskFactory::crea te(this, &FrameView::notifyRenderThrottlingObservers))
132 , m_isTransparent(false) 132 , m_isTransparent(false)
133 , m_baseBackgroundColor(Color::white) 133 , m_baseBackgroundColor(Color::white)
134 , m_mediaType(MediaTypeNames::screen) 134 , m_mediaType(MediaTypeNames::screen)
135 , m_safeToPropagateScrollToParent(true) 135 , m_safeToPropagateScrollToParent(true)
136 , m_isTrackingPaintInvalidations(false) 136 , m_isTrackingPaintInvalidations(false)
137 , m_scrollCorner(nullptr) 137 , m_scrollCorner(nullptr)
138 , m_stickyPositionObjectCount(0)
138 , m_inputEventsScaleFactorForEmulation(1) 139 , m_inputEventsScaleFactorForEmulation(1)
139 , m_layoutSizeFixedToFrameSize(true) 140 , m_layoutSizeFixedToFrameSize(true)
140 , m_didScrollTimer(this, &FrameView::didScrollTimerFired) 141 , m_didScrollTimer(this, &FrameView::didScrollTimerFired)
141 , m_topControlsViewportAdjustment(0) 142 , m_topControlsViewportAdjustment(0)
142 , m_needsUpdateWidgetGeometries(false) 143 , m_needsUpdateWidgetGeometries(false)
143 , m_needsUpdateViewportIntersection(true) 144 , m_needsUpdateViewportIntersection(true)
144 , m_needsUpdateViewportIntersectionInSubtree(true) 145 , m_needsUpdateViewportIntersectionInSubtree(true)
145 #if ENABLE(ASSERT) 146 #if ENABLE(ASSERT)
146 , m_hasBeenDisposed(false) 147 , m_hasBeenDisposed(false)
147 #endif 148 #endif
(...skipping 1461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1609 } 1610 }
1610 1611
1611 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() 1612 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded()
1612 { 1613 {
1613 // Nothing to do after scrolling if there are no fixed position elements. 1614 // Nothing to do after scrolling if there are no fixed position elements.
1614 if (!hasViewportConstrainedObjects()) 1615 if (!hasViewportConstrainedObjects())
1615 return; 1616 return;
1616 1617
1617 RefPtrWillBeRawPtr<FrameView> protect(this); 1618 RefPtrWillBeRawPtr<FrameView> protect(this);
1618 1619
1620 // Update sticky position objects which are stuck to the viewport.
1621 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) {
1622 LayoutObject* layoutObject = viewportConstrainedObject;
1623 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer();
1624 if (layoutObject->style()->position() == StickyPosition)
1625 layer->updateLayerPosition();
1626 }
1627
1619 // If there fixed position elements, scrolling may cause compositing layers to change. 1628 // If there fixed position elements, scrolling may cause compositing layers to change.
1620 // Update widget and layer positions after scrolling, but only if we're not inside of 1629 // Update widget and layer positions after scrolling, but only if we're not inside of
1621 // layout. 1630 // layout.
1622 if (!m_nestedLayoutCount) { 1631 if (!m_nestedLayoutCount) {
1623 updateWidgetGeometries(); 1632 updateWidgetGeometries();
1624 if (LayoutView* layoutView = this->layoutView()) 1633 if (LayoutView* layoutView = this->layoutView())
1625 layoutView->layer()->setNeedsCompositingInputsUpdate(); 1634 layoutView->layer()->setNeedsCompositingInputsUpdate();
1626 } 1635 }
1627 } 1636 }
1628 1637
(...skipping 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after
4095 return m_hiddenForThrottling && m_crossOriginForThrottling; 4104 return m_hiddenForThrottling && m_crossOriginForThrottling;
4096 } 4105 }
4097 4106
4098 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4107 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4099 { 4108 {
4100 ASSERT(layoutView()); 4109 ASSERT(layoutView());
4101 return *layoutView(); 4110 return *layoutView();
4102 } 4111 }
4103 4112
4104 } // namespace blink 4113 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698