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

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

Issue 1308273010: Adapt and reland old position sticky implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Merge and attempt to fix base URL Created 5 years, 1 month 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@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 // in this case, there is no need to dirty our ancestors further. 306 // in this case, there is no need to dirty our ancestors further.
307 if (layer->isSelfPaintingLayer()) { 307 if (layer->isSelfPaintingLayer()) {
308 ASSERT(!parent() || parent()->m_hasSelfPaintingLayerDescendantDirty || parent()->m_hasSelfPaintingLayerDescendant); 308 ASSERT(!parent() || parent()->m_hasSelfPaintingLayerDescendantDirty || parent()->m_hasSelfPaintingLayerDescendant);
309 break; 309 break;
310 } 310 }
311 } 311 }
312 } 312 }
313 313
314 bool PaintLayer::scrollsWithViewport() const 314 bool PaintLayer::scrollsWithViewport() const
315 { 315 {
316 return layoutObject()->style()->position() == FixedPosition && layoutObject( )->containerForFixedPosition() == layoutObject()->view(); 316 return (layoutObject()->style()->position() == FixedPosition && layoutObject ()->containerForFixedPosition() == layoutObject()->view())
317 || (layoutObject()->style()->position() == StickyPosition && !ancestorSc rollingLayer());
317 } 318 }
318 319
319 bool PaintLayer::scrollsWithRespectTo(const PaintLayer* other) const 320 bool PaintLayer::scrollsWithRespectTo(const PaintLayer* other) const
320 { 321 {
321 if (scrollsWithViewport() != other->scrollsWithViewport()) 322 if (scrollsWithViewport() != other->scrollsWithViewport())
322 return true; 323 return true;
323 return ancestorScrollingLayer() != other->ancestorScrollingLayer(); 324 return ancestorScrollingLayer() != other->ancestorScrollingLayer();
324 } 325 }
325 326
327 void PaintLayer::updateLayerPositionAfterFrameScroll(const DoubleSize& scrollDel ta)
328 {
329 updateLayerPosition();
330 }
331
326 void PaintLayer::updateLayerPositionsAfterOverflowScroll(const DoubleSize& scrol lDelta) 332 void PaintLayer::updateLayerPositionsAfterOverflowScroll(const DoubleSize& scrol lDelta)
327 { 333 {
328 m_clipper.clearClipRectsIncludingDescendants(); 334 m_clipper.clearClipRectsIncludingDescendants();
329 updateLayerPositionsAfterScrollRecursive(scrollDelta, isPaintInvalidationCon tainer()); 335 updateLayerPositionsAfterScrollRecursive(scrollDelta, isPaintInvalidationCon tainer());
330 } 336 }
331 337
332 void PaintLayer::updateLayerPositionsAfterScrollRecursive(const DoubleSize& scro llDelta, bool paintInvalidationContainerWasScrolled) 338 void PaintLayer::updateLayerPositionsAfterScrollRecursive(const DoubleSize& scro llDelta, bool paintInvalidationContainerWasScrolled)
333 { 339 {
334 updateLayerPosition(); 340 updateLayerPosition();
335 if (paintInvalidationContainerWasScrolled && !isPaintInvalidationContainer() ) { 341 if (paintInvalidationContainerWasScrolled && !isPaintInvalidationContainer() ) {
(...skipping 2399 matching lines...) Expand 10 before | Expand all | Expand 10 after
2735 2741
2736 void showLayerTree(const blink::LayoutObject* layoutObject) 2742 void showLayerTree(const blink::LayoutObject* layoutObject)
2737 { 2743 {
2738 if (!layoutObject) { 2744 if (!layoutObject) {
2739 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2745 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2740 return; 2746 return;
2741 } 2747 }
2742 showLayerTree(layoutObject->enclosingLayer()); 2748 showLayerTree(layoutObject->enclosingLayer());
2743 } 2749 }
2744 #endif 2750 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698