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

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

Issue 1850703002: Revert "Adapt and reland old position sticky implementation from https://codereview.chromium.org/34… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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)
139 , m_inputEventsScaleFactorForEmulation(1) 138 , m_inputEventsScaleFactorForEmulation(1)
140 , m_layoutSizeFixedToFrameSize(true) 139 , m_layoutSizeFixedToFrameSize(true)
141 , m_didScrollTimer(this, &FrameView::didScrollTimerFired) 140 , m_didScrollTimer(this, &FrameView::didScrollTimerFired)
142 , m_topControlsViewportAdjustment(0) 141 , m_topControlsViewportAdjustment(0)
143 , m_needsUpdateWidgetGeometries(false) 142 , m_needsUpdateWidgetGeometries(false)
144 , m_needsUpdateViewportIntersection(true) 143 , m_needsUpdateViewportIntersection(true)
145 , m_needsUpdateViewportIntersectionInSubtree(true) 144 , m_needsUpdateViewportIntersectionInSubtree(true)
146 #if ENABLE(ASSERT) 145 #if ENABLE(ASSERT)
147 , m_hasBeenDisposed(false) 146 , m_hasBeenDisposed(false)
148 #endif 147 #endif
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1607 } 1606 }
1608 1607
1609 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded() 1608 void FrameView::updateLayersAndCompositingAfterScrollIfNeeded()
1610 { 1609 {
1611 // Nothing to do after scrolling if there are no fixed position elements. 1610 // Nothing to do after scrolling if there are no fixed position elements.
1612 if (!hasViewportConstrainedObjects()) 1611 if (!hasViewportConstrainedObjects())
1613 return; 1612 return;
1614 1613
1615 RefPtrWillBeRawPtr<FrameView> protect(this); 1614 RefPtrWillBeRawPtr<FrameView> protect(this);
1616 1615
1617 // Update sticky position objects which are stuck to the viewport.
1618 for (const auto& viewportConstrainedObject : *m_viewportConstrainedObjects) {
1619 LayoutObject* layoutObject = viewportConstrainedObject;
1620 PaintLayer* layer = toLayoutBoxModelObject(layoutObject)->layer();
1621 if (layoutObject->style()->position() == StickyPosition)
1622 layer->updateLayerPosition();
1623 }
1624
1625 // If there fixed position elements, scrolling may cause compositing layers to change. 1616 // If there fixed position elements, scrolling may cause compositing layers to change.
1626 // Update widget and layer positions after scrolling, but only if we're not inside of 1617 // Update widget and layer positions after scrolling, but only if we're not inside of
1627 // layout. 1618 // layout.
1628 if (!m_nestedLayoutCount) { 1619 if (!m_nestedLayoutCount) {
1629 updateWidgetGeometries(); 1620 updateWidgetGeometries();
1630 if (LayoutView* layoutView = this->layoutView()) 1621 if (LayoutView* layoutView = this->layoutView())
1631 layoutView->layer()->setNeedsCompositingInputsUpdate(); 1622 layoutView->layer()->setNeedsCompositingInputsUpdate();
1632 } 1623 }
1633 } 1624 }
1634 1625
(...skipping 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after
4101 return m_hiddenForThrottling && m_crossOriginForThrottling; 4092 return m_hiddenForThrottling && m_crossOriginForThrottling;
4102 } 4093 }
4103 4094
4104 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const 4095 LayoutBox& FrameView::boxForScrollControlPaintInvalidation() const
4105 { 4096 {
4106 ASSERT(layoutView()); 4097 ASSERT(layoutView());
4107 return *layoutView(); 4098 return *layoutView();
4108 } 4099 }
4109 4100
4110 } // namespace blink 4101 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutBlock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698