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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 1870663002: Reland main thread position sticky implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only descend into children which have an ancestor overflow layer. 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@gmail.com> 9 * Christian Biesinger <cbiesinger@gmail.com>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 1217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 m_resizer = LayoutScrollbarPart::createAnonymous(&box().document(), this); 1228 m_resizer = LayoutScrollbarPart::createAnonymous(&box().document(), this);
1229 m_resizer->setDangerousOneWayParent(&box()); 1229 m_resizer->setDangerousOneWayParent(&box());
1230 } 1230 }
1231 m_resizer->setStyleWithWritingModeOfParent(resizer.release()); 1231 m_resizer->setStyleWithWritingModeOfParent(resizer.release());
1232 } else if (m_resizer) { 1232 } else if (m_resizer) {
1233 m_resizer->destroy(); 1233 m_resizer->destroy();
1234 m_resizer = nullptr; 1234 m_resizer = nullptr;
1235 } 1235 }
1236 } 1236 }
1237 1237
1238 void PaintLayerScrollableArea::invalidateAllStickyConstraints()
1239 {
1240 if (PaintLayerScrollableAreaRareData* d = rareData()) {
1241 for (PaintLayer* stickyLayer : d->m_stickyConstraintsMap.keys()) {
1242 if (stickyLayer->layoutObject()->style()->position() == StickyPositi on)
1243 stickyLayer->setNeedsCompositingInputsUpdate();
1244 }
1245 d->m_stickyConstraintsMap.clear();
1246 }
1247 }
1248
1249 void PaintLayerScrollableArea::invalidateStickyConstraintsFor(PaintLayer* layer, bool needsCompositingUpdate)
1250 {
1251 if (PaintLayerScrollableAreaRareData* d = rareData()) {
1252 d->m_stickyConstraintsMap.remove(layer);
1253 if (needsCompositingUpdate && layer->layoutObject()->style()->position() == StickyPosition)
1254 layer->setNeedsCompositingInputsUpdate();
1255 }
1256 }
1257
1238 IntSize PaintLayerScrollableArea::offsetFromResizeCorner(const IntPoint& absolut ePoint) const 1258 IntSize PaintLayerScrollableArea::offsetFromResizeCorner(const IntPoint& absolut ePoint) const
1239 { 1259 {
1240 // Currently the resize corner is either the bottom right corner or the bott om left corner. 1260 // Currently the resize corner is either the bottom right corner or the bott om left corner.
1241 // FIXME: This assumes the location is 0, 0. Is this guaranteed to always be the case? 1261 // FIXME: This assumes the location is 0, 0. Is this guaranteed to always be the case?
1242 IntSize elementSize = layer()->size(); 1262 IntSize elementSize = layer()->size();
1243 if (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 1263 if (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
1244 elementSize.setWidth(0); 1264 elementSize.setWidth(0);
1245 IntPoint resizerPoint = IntPoint(elementSize); 1265 IntPoint resizerPoint = IntPoint(elementSize);
1246 IntPoint localPoint = roundedIntPoint(box().absoluteToLocal(absolutePoint, U seTransforms)); 1266 IntPoint localPoint = roundedIntPoint(box().absoluteToLocal(absolutePoint, U seTransforms));
1247 return localPoint - resizerPoint; 1267 return localPoint - resizerPoint;
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1586 } 1606 }
1587 1607
1588 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) 1608 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager)
1589 { 1609 {
1590 visitor->trace(m_scrollableArea); 1610 visitor->trace(m_scrollableArea);
1591 visitor->trace(m_hBar); 1611 visitor->trace(m_hBar);
1592 visitor->trace(m_vBar); 1612 visitor->trace(m_vBar);
1593 } 1613 }
1594 1614
1595 } // namespace blink 1615 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h ('k') | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698