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

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

Issue 1308273010: Adapt and reland old position sticky implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Store ancestor overflow layer on PaintLayer to compute before other dependent compositing inputs. 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) 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 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 m_resizer = LayoutScrollbarPart::createAnonymous(&box().document()); 1225 m_resizer = LayoutScrollbarPart::createAnonymous(&box().document());
1226 m_resizer->setDangerousOneWayParent(&box()); 1226 m_resizer->setDangerousOneWayParent(&box());
1227 } 1227 }
1228 m_resizer->setStyleWithWritingModeOfParent(resizer.release()); 1228 m_resizer->setStyleWithWritingModeOfParent(resizer.release());
1229 } else if (m_resizer) { 1229 } else if (m_resizer) {
1230 m_resizer->destroy(); 1230 m_resizer->destroy();
1231 m_resizer = nullptr; 1231 m_resizer = nullptr;
1232 } 1232 }
1233 } 1233 }
1234 1234
1235 void PaintLayerScrollableArea::invalidateStickyConstraints()
1236 {
1237 if (PaintLayerScrollableAreaRareData* d = rareData()) {
1238 for (PaintLayer* stickyLayer : d->m_stickyConstraintsMap.keys()) {
1239 stickyLayer->setNeedsCompositingInputsUpdate();
1240 }
1241 d->m_stickyConstraintsMap.clear();
1242 }
1243 }
1244
1245 void PaintLayerScrollableArea::invalidateStickyConstraintsFor(PaintLayer* layer)
1246 {
1247 if (PaintLayerScrollableAreaRareData* d = rareData()) {
1248 d->m_stickyConstraintsMap.remove(layer);
1249 }
1250 }
1251
1235 IntSize PaintLayerScrollableArea::offsetFromResizeCorner(const IntPoint& absolut ePoint) const 1252 IntSize PaintLayerScrollableArea::offsetFromResizeCorner(const IntPoint& absolut ePoint) const
1236 { 1253 {
1237 // Currently the resize corner is either the bottom right corner or the bott om left corner. 1254 // Currently the resize corner is either the bottom right corner or the bott om left corner.
1238 // FIXME: This assumes the location is 0, 0. Is this guaranteed to always be the case? 1255 // FIXME: This assumes the location is 0, 0. Is this guaranteed to always be the case?
1239 IntSize elementSize = layer()->size(); 1256 IntSize elementSize = layer()->size();
1240 if (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 1257 if (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
1241 elementSize.setWidth(0); 1258 elementSize.setWidth(0);
1242 IntPoint resizerPoint = IntPoint(elementSize); 1259 IntPoint resizerPoint = IntPoint(elementSize);
1243 IntPoint localPoint = roundedIntPoint(box().absoluteToLocal(absolutePoint, U seTransforms)); 1260 IntPoint localPoint = roundedIntPoint(box().absoluteToLocal(absolutePoint, U seTransforms));
1244 return localPoint - resizerPoint; 1261 return localPoint - resizerPoint;
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 } 1591 }
1575 1592
1576 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) 1593 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager)
1577 { 1594 {
1578 visitor->trace(m_scrollableArea); 1595 visitor->trace(m_scrollableArea);
1579 visitor->trace(m_hBar); 1596 visitor->trace(m_hBar);
1580 visitor->trace(m_vBar); 1597 visitor->trace(m_vBar);
1581 } 1598 }
1582 1599
1583 } // namespace blink 1600 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698