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

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: Make sticky vertical ref tests expectations not dependent on font size. 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 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 m_resizer = LayoutScrollbarPart::createAnonymous(&box().document()); 1227 m_resizer = LayoutScrollbarPart::createAnonymous(&box().document());
1228 m_resizer->setDangerousOneWayParent(&box()); 1228 m_resizer->setDangerousOneWayParent(&box());
1229 } 1229 }
1230 m_resizer->setStyleWithWritingModeOfParent(resizer.release()); 1230 m_resizer->setStyleWithWritingModeOfParent(resizer.release());
1231 } else if (m_resizer) { 1231 } else if (m_resizer) {
1232 m_resizer->destroy(); 1232 m_resizer->destroy();
1233 m_resizer = nullptr; 1233 m_resizer = nullptr;
1234 } 1234 }
1235 } 1235 }
1236 1236
1237 void PaintLayerScrollableArea::invalidateAllStickyConstraints()
1238 {
1239 if (PaintLayerScrollableAreaRareData* d = rareData()) {
1240 for (PaintLayer* stickyLayer : d->m_stickyConstraintsMap.keys()) {
1241 if (stickyLayer->layoutObject()->style()->position() == StickyPositi on)
1242 stickyLayer->setNeedsCompositingInputsUpdate();
1243 }
1244 d->m_stickyConstraintsMap.clear();
1245 }
1246 }
1247
1248 void PaintLayerScrollableArea::invalidateStickyConstraintsFor(PaintLayer* layer, bool needsCompositingUpdate)
1249 {
1250 if (PaintLayerScrollableAreaRareData* d = rareData()) {
1251 d->m_stickyConstraintsMap.remove(layer);
1252 if (needsCompositingUpdate && layer->layoutObject()->style()->position() == StickyPosition)
1253 layer->setNeedsCompositingInputsUpdate();
1254 }
1255 }
1256
1237 IntSize PaintLayerScrollableArea::offsetFromResizeCorner(const IntPoint& absolut ePoint) const 1257 IntSize PaintLayerScrollableArea::offsetFromResizeCorner(const IntPoint& absolut ePoint) const
1238 { 1258 {
1239 // Currently the resize corner is either the bottom right corner or the bott om left corner. 1259 // Currently the resize corner is either the bottom right corner or the bott om left corner.
1240 // FIXME: This assumes the location is 0, 0. Is this guaranteed to always be the case? 1260 // FIXME: This assumes the location is 0, 0. Is this guaranteed to always be the case?
1241 IntSize elementSize = layer()->size(); 1261 IntSize elementSize = layer()->size();
1242 if (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft()) 1262 if (box().shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
1243 elementSize.setWidth(0); 1263 elementSize.setWidth(0);
1244 IntPoint resizerPoint = IntPoint(elementSize); 1264 IntPoint resizerPoint = IntPoint(elementSize);
1245 IntPoint localPoint = roundedIntPoint(box().absoluteToLocal(absolutePoint, U seTransforms)); 1265 IntPoint localPoint = roundedIntPoint(box().absoluteToLocal(absolutePoint, U seTransforms));
1246 return localPoint - resizerPoint; 1266 return localPoint - resizerPoint;
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 } 1605 }
1586 1606
1587 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager) 1607 DEFINE_TRACE(PaintLayerScrollableArea::ScrollbarManager)
1588 { 1608 {
1589 visitor->trace(m_scrollableArea); 1609 visitor->trace(m_scrollableArea);
1590 visitor->trace(m_hBar); 1610 visitor->trace(m_hBar);
1591 visitor->trace(m_vBar); 1611 visitor->trace(m_vBar);
1592 } 1612 }
1593 1613
1594 } // namespace blink 1614 } // 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