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

Side by Side Diff: Source/core/rendering/RenderLayer.cpp

Issue 209663007: Fix bug in scrollParent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 // ancestor, and we need not be composited. If, on the other hand, we reside in a z-order 1745 // ancestor, and we need not be composited. If, on the other hand, we reside in a z-order
1746 // list, and on our walk upwards to our scrolling ancestor we find no layer that is a stacking 1746 // list, and on our walk upwards to our scrolling ancestor we find no layer that is a stacking
1747 // context, then we know that in the stacking tree, we will not be in the su btree rooted at 1747 // context, then we know that in the stacking tree, we will not be in the su btree rooted at
1748 // our scrolling ancestor, and we will therefore not scroll with it. In this case, we must 1748 // our scrolling ancestor, and we will therefore not scroll with it. In this case, we must
1749 // be a composited layer since the compositor will need to take special meas ures to ensure 1749 // be a composited layer since the compositor will need to take special meas ures to ensure
1750 // that we scroll with our scrolling ancestor and it cannot do this if we do not promote. 1750 // that we scroll with our scrolling ancestor and it cannot do this if we do not promote.
1751 if (m_ancestorDependentPropertyCache && !m_ancestorDependentPropertyCache->s crollParentDirty()) 1751 if (m_ancestorDependentPropertyCache && !m_ancestorDependentPropertyCache->s crollParentDirty())
1752 return m_ancestorDependentPropertyCache->scrollParent(); 1752 return m_ancestorDependentPropertyCache->scrollParent();
1753 1753
1754 RenderLayer* scrollParent = ancestorCompositedScrollingLayer(); 1754 RenderLayer* scrollParent = ancestorCompositedScrollingLayer();
1755 if (!scrollParent || scrollParent->stackingNode()->isStackingContainer()) 1755 if (!scrollParent || scrollParent->stackingNode()->isStackingContainer()) {
1756 if (m_ancestorDependentPropertyCache)
1757 m_ancestorDependentPropertyCache->setScrollParent(0);
1756 return 0; 1758 return 0;
1759 }
1757 1760
1758 // If we hit a stacking context on our way up to the ancestor scrolling laye r, it will already 1761 // If we hit a stacking context on our way up to the ancestor scrolling laye r, it will already
1759 // be composited due to an overflow scrolling parent, so we don't need to. 1762 // be composited due to an overflow scrolling parent, so we don't need to.
1760 for (RenderLayer* ancestor = parent(); ancestor && ancestor != scrollParent; ancestor = ancestor->parent()) { 1763 for (RenderLayer* ancestor = parent(); ancestor && ancestor != scrollParent; ancestor = ancestor->parent()) {
1761 if (ancestor->stackingNode()->isStackingContainer()) 1764 if (ancestor->stackingNode()->isStackingContainer()) {
1762 return 0; 1765 scrollParent = 0;
1766 break;
1767 }
1763 if (!isInCompositingUpdate()) 1768 if (!isInCompositingUpdate())
1764 continue; 1769 continue;
1765 if (AncestorDependentPropertyCache* ancestorCache = ancestor->m_ancestor DependentPropertyCache.get()) { 1770 if (AncestorDependentPropertyCache* ancestorCache = ancestor->m_ancestor DependentPropertyCache.get()) {
1766 if (!ancestorCache->ancestorCompositedScrollingLayerDirty() && ances torCache->ancestorCompositedScrollingLayer() == scrollParent) { 1771 if (!ancestorCache->ancestorCompositedScrollingLayerDirty() && ances torCache->ancestorCompositedScrollingLayer() == scrollParent) {
1767 scrollParent = ancestorCache->scrollParent(); 1772 scrollParent = ancestorCache->scrollParent();
1768 break; 1773 break;
1769 } 1774 }
1770 } 1775 }
1771 } 1776 }
1772 1777
(...skipping 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after
4175 } 4180 }
4176 } 4181 }
4177 4182
4178 void showLayerTree(const WebCore::RenderObject* renderer) 4183 void showLayerTree(const WebCore::RenderObject* renderer)
4179 { 4184 {
4180 if (!renderer) 4185 if (!renderer)
4181 return; 4186 return;
4182 showLayerTree(renderer->enclosingLayer()); 4187 showLayerTree(renderer->enclosingLayer());
4183 } 4188 }
4184 #endif 4189 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698