Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 307 // in this case, there is no need to dirty our ancestors further. | 307 // in this case, there is no need to dirty our ancestors further. |
| 308 if (layer->isSelfPaintingLayer()) { | 308 if (layer->isSelfPaintingLayer()) { |
| 309 ASSERT(!parent() || parent()->m_hasSelfPaintingLayerDescendantDirty || parent()->m_hasSelfPaintingLayerDescendant); | 309 ASSERT(!parent() || parent()->m_hasSelfPaintingLayerDescendantDirty || parent()->m_hasSelfPaintingLayerDescendant); |
| 310 break; | 310 break; |
| 311 } | 311 } |
| 312 } | 312 } |
| 313 } | 313 } |
| 314 | 314 |
| 315 bool PaintLayer::scrollsWithViewport() const | 315 bool PaintLayer::scrollsWithViewport() const |
| 316 { | 316 { |
| 317 return layoutObject()->style()->position() == FixedPosition && layoutObject( )->containerForFixedPosition() == layoutObject()->view(); | 317 return (layoutObject()->style()->position() == FixedPosition && layoutObject ()->containerForFixedPosition() == layoutObject()->view()) |
| 318 || (layoutObject()->style()->position() == StickyPosition && !ancestorSc rollingLayer()); | |
| 318 } | 319 } |
| 319 | 320 |
| 320 bool PaintLayer::scrollsWithRespectTo(const PaintLayer* other) const | 321 bool PaintLayer::scrollsWithRespectTo(const PaintLayer* other) const |
| 321 { | 322 { |
| 322 if (scrollsWithViewport() != other->scrollsWithViewport()) | 323 if (scrollsWithViewport() != other->scrollsWithViewport()) |
| 323 return true; | 324 return true; |
| 324 return ancestorScrollingLayer() != other->ancestorScrollingLayer(); | 325 return ancestorScrollingLayer() != other->ancestorScrollingLayer(); |
| 325 } | 326 } |
| 326 | 327 |
| 328 void PaintLayer::updateLayerPositionAfterFrameScroll(const DoubleSize& scrollDel ta) | |
|
chrishtr
2015/12/09 00:37:38
What's the point of declaring a new method with an
flackr
2015/12/10 23:43:15
I was trying to be consistent with the other metho
| |
| 329 { | |
| 330 updateLayerPosition(); | |
| 331 } | |
| 332 | |
| 327 void PaintLayer::updateLayerPositionsAfterOverflowScroll(const DoubleSize& scrol lDelta) | 333 void PaintLayer::updateLayerPositionsAfterOverflowScroll(const DoubleSize& scrol lDelta) |
| 328 { | 334 { |
| 329 m_clipper.clearClipRectsIncludingDescendants(); | 335 m_clipper.clearClipRectsIncludingDescendants(); |
| 330 updateLayerPositionsAfterScrollRecursive(scrollDelta, isPaintInvalidationCon tainer()); | 336 updateLayerPositionsAfterScrollRecursive(scrollDelta, isPaintInvalidationCon tainer()); |
| 331 } | 337 } |
| 332 | 338 |
| 333 void PaintLayer::updateLayerPositionsAfterScrollRecursive(const DoubleSize& scro llDelta, bool paintInvalidationContainerWasScrolled) | 339 void PaintLayer::updateLayerPositionsAfterScrollRecursive(const DoubleSize& scro llDelta, bool paintInvalidationContainerWasScrolled) |
| 334 { | 340 { |
| 335 updateLayerPosition(); | 341 updateLayerPosition(); |
| 336 if (paintInvalidationContainerWasScrolled && !isPaintInvalidationContainer() ) { | 342 if (paintInvalidationContainerWasScrolled && !isPaintInvalidationContainer() ) { |
| (...skipping 2443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2780 | 2786 |
| 2781 void showLayerTree(const blink::LayoutObject* layoutObject) | 2787 void showLayerTree(const blink::LayoutObject* layoutObject) |
| 2782 { | 2788 { |
| 2783 if (!layoutObject) { | 2789 if (!layoutObject) { |
| 2784 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2790 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
| 2785 return; | 2791 return; |
| 2786 } | 2792 } |
| 2787 showLayerTree(layoutObject->enclosingLayer()); | 2793 showLayerTree(layoutObject->enclosingLayer()); |
| 2788 } | 2794 } |
| 2789 #endif | 2795 #endif |
| OLD | NEW |