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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 DeprecatedPaintLayer::scrollsWithViewport() const | 314 bool DeprecatedPaintLayer::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()); | |
| 318 } | |
| 319 | |
| 320 bool DeprecatedPaintLayer::scrollsWithScrollAncestor() const | |
| 321 { | |
| 322 // TODO(flackr): This could check if the ancestor scroller for this layer is scrollable and | |
| 323 // composited but this would need to be determined before the composite phas e as it's used | |
| 324 // as a compositing reason. | |
|
flackr
2015/09/15 21:13:11
Is there an easy way to check the scroll ancestor
| |
| 325 return layoutObject()->style()->position() == StickyPosition; | |
| 317 } | 326 } |
| 318 | 327 |
| 319 bool DeprecatedPaintLayer::scrollsWithRespectTo(const DeprecatedPaintLayer* othe r) const | 328 bool DeprecatedPaintLayer::scrollsWithRespectTo(const DeprecatedPaintLayer* othe r) const |
| 320 { | 329 { |
| 321 if (scrollsWithViewport() != other->scrollsWithViewport()) | 330 if (scrollsWithViewport() != other->scrollsWithViewport()) |
| 322 return true; | 331 return true; |
| 323 return ancestorScrollingLayer() != other->ancestorScrollingLayer(); | 332 return ancestorScrollingLayer() != other->ancestorScrollingLayer(); |
| 324 } | 333 } |
| 325 | 334 |
| 326 void DeprecatedPaintLayer::updateLayerPositionsAfterOverflowScroll(const DoubleS ize& scrollDelta) | 335 void DeprecatedPaintLayer::updateLayerPositionsAfterOverflowScroll(const DoubleS ize& scrollDelta) |
| (...skipping 2415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2742 | 2751 |
| 2743 void showLayerTree(const blink::LayoutObject* layoutObject) | 2752 void showLayerTree(const blink::LayoutObject* layoutObject) |
| 2744 { | 2753 { |
| 2745 if (!layoutObject) { | 2754 if (!layoutObject) { |
| 2746 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2755 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
| 2747 return; | 2756 return; |
| 2748 } | 2757 } |
| 2749 showLayerTree(layoutObject->enclosingLayer()); | 2758 showLayerTree(layoutObject->enclosingLayer()); |
| 2750 } | 2759 } |
| 2751 #endif | 2760 #endif |
| OLD | NEW |