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

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

Issue 14863002: Only update composited-scrolling state once after layout. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address reviewer comments. Created 7 years, 7 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
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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 137 }
138 138
139 RenderLayer::RenderLayer(RenderLayerModelObject* renderer) 139 RenderLayer::RenderLayer(RenderLayerModelObject* renderer)
140 : m_inResizeMode(false) 140 : m_inResizeMode(false)
141 , m_scrollDimensionsDirty(true) 141 , m_scrollDimensionsDirty(true)
142 , m_normalFlowListDirty(true) 142 , m_normalFlowListDirty(true)
143 , m_hasSelfPaintingLayerDescendant(false) 143 , m_hasSelfPaintingLayerDescendant(false)
144 , m_hasSelfPaintingLayerDescendantDirty(false) 144 , m_hasSelfPaintingLayerDescendantDirty(false)
145 , m_hasOutOfFlowPositionedDescendant(false) 145 , m_hasOutOfFlowPositionedDescendant(false)
146 , m_hasOutOfFlowPositionedDescendantDirty(true) 146 , m_hasOutOfFlowPositionedDescendantDirty(true)
147 , m_hasUnclippedDescendant(false)
147 , m_forceNeedsCompositedScrolling(DoNotForceCompositedScrolling) 148 , m_forceNeedsCompositedScrolling(DoNotForceCompositedScrolling)
148 , m_needsCompositedScrolling(false) 149 , m_needsCompositedScrolling(false)
149 , m_descendantsAreContiguousInStackingOrder(false) 150 , m_descendantsAreContiguousInStackingOrder(false)
150 , m_descendantsAreContiguousInStackingOrderDirty(true) 151 , m_descendantsAreContiguousInStackingOrderDirty(true)
151 , m_isRootLayer(renderer->isRenderView()) 152 , m_isRootLayer(renderer->isRenderView())
152 , m_usedTransparency(false) 153 , m_usedTransparency(false)
153 , m_paintingInsideReflection(false) 154 , m_paintingInsideReflection(false)
154 , m_inOverflowRelayout(false) 155 , m_inOverflowRelayout(false)
155 , m_repaintStatus(NeedsNormalRepaint) 156 , m_repaintStatus(NeedsNormalRepaint)
156 , m_visibleContentStatusDirty(true) 157 , m_visibleContentStatusDirty(true)
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 if (FrameView* frameView = frame->view()) 220 if (FrameView* frameView = frame->view())
220 frameView->removeScrollableArea(this); 221 frameView->removeScrollableArea(this);
221 } 222 }
222 223
223 if (!m_renderer->documentBeingDestroyed()) { 224 if (!m_renderer->documentBeingDestroyed()) {
224 Node* node = m_renderer->node(); 225 Node* node = m_renderer->node();
225 if (node && node->isElementNode()) 226 if (node && node->isElementNode())
226 toElement(node)->setSavedLayerScrollOffset(m_scrollOffset); 227 toElement(node)->setSavedLayerScrollOffset(m_scrollOffset);
227 } 228 }
228 229
230 if (!m_renderer->documentBeingDestroyed())
231 compositor()->removeOutOfFlowPositionedLayer(this);
232
229 destroyScrollbar(HorizontalScrollbar); 233 destroyScrollbar(HorizontalScrollbar);
230 destroyScrollbar(VerticalScrollbar); 234 destroyScrollbar(VerticalScrollbar);
231 235
232 if (renderer()->frame() && renderer()->frame()->page()) { 236 if (renderer()->frame() && renderer()->frame()->page()) {
233 if (ScrollingCoordinator* scrollingCoordinator = renderer()->frame()->pa ge()->scrollingCoordinator()) 237 if (ScrollingCoordinator* scrollingCoordinator = renderer()->frame()->pa ge()->scrollingCoordinator())
234 scrollingCoordinator->willDestroyScrollableArea(this); 238 scrollingCoordinator->willDestroyScrollableArea(this);
235 } 239 }
236 240
237 if (m_reflection) 241 if (m_reflection)
238 removeReflection(); 242 removeReflection();
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 layer->m_hasSelfPaintingLayerDescendantDirty = true; 473 layer->m_hasSelfPaintingLayerDescendantDirty = true;
470 // If we have reached a self-painting layer, we know our parent should h ave a self-painting descendant 474 // If we have reached a self-painting layer, we know our parent should h ave a self-painting descendant
471 // in this case, there is no need to dirty our ancestors further. 475 // in this case, there is no need to dirty our ancestors further.
472 if (layer->isSelfPaintingLayer()) { 476 if (layer->isSelfPaintingLayer()) {
473 ASSERT(!parent() || parent()->m_hasSelfPaintingLayerDescendantDirty || parent()->hasSelfPaintingLayerDescendant()); 477 ASSERT(!parent() || parent()->m_hasSelfPaintingLayerDescendantDirty || parent()->hasSelfPaintingLayerDescendant());
474 break; 478 break;
475 } 479 }
476 } 480 }
477 } 481 }
478 482
483 void RenderLayer::setAncestorChainHasOutOfFlowPositionedDescendant()
484 {
485 for (RenderLayer* layer = this; layer; layer = layer->parent()) {
486 if (!layer->m_hasOutOfFlowPositionedDescendantDirty && layer->hasOutOfFl owPositionedDescendant())
487 break;
488
489 layer->m_hasOutOfFlowPositionedDescendantDirty = false;
490 layer->m_hasOutOfFlowPositionedDescendant = true;
491 }
492 }
493
494 void RenderLayer::dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus()
495 {
496 for (RenderLayer* layer = this; layer; layer = layer->parent()) {
497 layer->m_hasOutOfFlowPositionedDescendantDirty = true;
498
499 // We may or may not have an unclipped descendant. If we do, we'll reset
500 // this to true the next time composited scrolling state is updated.
501 layer->m_hasUnclippedDescendant = false;
502
503 // If we have reached an out of flow positioned layer, we know our paren t should have an out-of-flow positioned descendant.
504 // In this case, there is no need to dirty our ancestors further.
505 if (layer->renderer()->isOutOfFlowPositioned()) {
506 ASSERT(!parent() || parent()->m_hasOutOfFlowPositionedDescendantDirt y || parent()->hasOutOfFlowPositionedDescendant());
507 break;
508 }
509 }
510 }
511
479 bool RenderLayer::acceleratedCompositingForOverflowScrollEnabled() const 512 bool RenderLayer::acceleratedCompositingForOverflowScrollEnabled() const
480 { 513 {
481 return renderer()->frame() 514 return renderer()->frame()
482 && renderer()->frame()->page() 515 && renderer()->frame()->page()
483 && renderer()->frame()->page()->settings()->acceleratedCompositingForOve rflowScrollEnabled(); 516 && renderer()->frame()->page()->settings()->acceleratedCompositingForOve rflowScrollEnabled();
484 } 517 }
485 518
486 // If we are a stacking container, then this function will determine if our 519 // If we are a stacking container, then this function will determine if our
487 // descendants for a contiguous block in stacking order. This is required in 520 // descendants for a contiguous block in stacking order. This is required in
488 // order for an element to be safely promoted to a stacking container. It is saf e 521 // order for an element to be safely promoted to a stacking container. It is saf e
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 // maxStackIndex - minStackIndex == numSCDescendants 591 // maxStackIndex - minStackIndex == numSCDescendants
559 // ===> 3 - 0 == 3 592 // ===> 3 - 0 == 3
560 // ===> 3 == 3 593 // ===> 3 == 3
561 // 594 //
562 // And we would conclude that C could be promoted. 595 // And we would conclude that C could be promoted.
563 void RenderLayer::updateDescendantsAreContiguousInStackingOrder() 596 void RenderLayer::updateDescendantsAreContiguousInStackingOrder()
564 { 597 {
565 if (!m_descendantsAreContiguousInStackingOrderDirty || !isStackingContext() || !acceleratedCompositingForOverflowScrollEnabled()) 598 if (!m_descendantsAreContiguousInStackingOrderDirty || !isStackingContext() || !acceleratedCompositingForOverflowScrollEnabled())
566 return; 599 return;
567 600
568 ASSERT(!m_normalFlowListDirty);
569 ASSERT(!m_zOrderListsDirty);
570
571 OwnPtr<Vector<RenderLayer*> > posZOrderList; 601 OwnPtr<Vector<RenderLayer*> > posZOrderList;
572 OwnPtr<Vector<RenderLayer*> > negZOrderList; 602 OwnPtr<Vector<RenderLayer*> > negZOrderList;
573 rebuildZOrderLists(StopAtStackingContexts, posZOrderList, negZOrderList); 603 rebuildZOrderLists(StopAtStackingContexts, posZOrderList, negZOrderList);
574 604
575 // Create a reverse lookup. 605 // Create a reverse lookup.
576 HashMap<const RenderLayer*, int> lookup; 606 HashMap<const RenderLayer*, int> lookup;
577 607
578 if (negZOrderList) { 608 if (negZOrderList) {
579 int stackingOrderIndex = -1; 609 int stackingOrderIndex = -1;
580 size_t listSize = negZOrderList->size(); 610 size_t listSize = negZOrderList->size();
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 int childCount = 0; 653 int childCount = 0;
624 child->updateDescendantsAreContiguousInStackingOrderRecursive(lookup, ch ildMinIndex, childMaxIndex, childCount, false); 654 child->updateDescendantsAreContiguousInStackingOrderRecursive(lookup, ch ildMinIndex, childMaxIndex, childCount, false);
625 if (childCount) { 655 if (childCount) {
626 count += childCount; 656 count += childCount;
627 minIndex = std::min(minIndex, childMinIndex); 657 minIndex = std::min(minIndex, childMinIndex);
628 maxIndex = std::max(maxIndex, childMaxIndex); 658 maxIndex = std::max(maxIndex, childMaxIndex);
629 } 659 }
630 } 660 }
631 661
632 if (!isStackingContext()) { 662 if (!isStackingContext()) {
633 bool newValue = maxIndex - minIndex == count; 663 m_descendantsAreContiguousInStackingOrder = (maxIndex - minIndex) == cou nt;
634 bool didUpdate = newValue != m_descendantsAreContiguousInStackingOrder; 664 m_descendantsAreContiguousInStackingOrderDirty = false;
635 m_descendantsAreContiguousInStackingOrder = newValue;
636 if (didUpdate)
637 updateNeedsCompositedScrolling();
638 } 665 }
639 } 666 }
640 667
641 static inline bool isPositionedContainer(const RenderLayer* layer) 668 static inline bool isPositionedContainer(const RenderLayer* layer)
642 { 669 {
643 // FIXME: This is not in sync with containingBlock. 670 // FIXME: This is not in sync with containingBlock.
644 // RenderObject::canContainFixedPositionedObject() should probably be used 671 // RenderObject::canContainFixedPositionedObject() should probably be used
645 // instead. 672 // instead.
646 RenderLayerModelObject* layerRenderer = layer->renderer(); 673 RenderLayerModelObject* layerRenderer = layer->renderer();
647 return layer->isRootLayer() || layerRenderer->isPositioned() || layer->hasTr ansform(); 674 return layer->isRootLayer() || layerRenderer->isPositioned() || layer->hasTr ansform();
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 if (curr == ancestorStackingContainer) 1083 if (curr == ancestorStackingContainer)
1057 return; 1084 return;
1058 } 1085 }
1059 } 1086 }
1060 1087
1061 bool RenderLayer::canBeStackingContainer() const 1088 bool RenderLayer::canBeStackingContainer() const
1062 { 1089 {
1063 if (isStackingContext() || !ancestorStackingContainer()) 1090 if (isStackingContext() || !ancestorStackingContainer())
1064 return true; 1091 return true;
1065 1092
1093 ASSERT(!m_descendantsAreContiguousInStackingOrderDirty);
1066 return m_descendantsAreContiguousInStackingOrder; 1094 return m_descendantsAreContiguousInStackingOrder;
1067 } 1095 }
1068 1096
1069 void RenderLayer::setHasVisibleContent() 1097 void RenderLayer::setHasVisibleContent()
1070 { 1098 {
1071 if (m_hasVisibleContent && !m_visibleContentStatusDirty) { 1099 if (m_hasVisibleContent && !m_visibleContentStatusDirty) {
1072 ASSERT(!parent() || parent()->hasVisibleDescendant()); 1100 ASSERT(!parent() || parent()->hasVisibleDescendant());
1073 return; 1101 return;
1074 } 1102 }
1075 1103
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 { 1140 {
1113 for (RenderLayer* layer = this; layer; layer = layer->parent()) { 1141 for (RenderLayer* layer = this; layer; layer = layer->parent()) {
1114 if (!layer->m_visibleDescendantStatusDirty && layer->hasVisibleDescendan t()) 1142 if (!layer->m_visibleDescendantStatusDirty && layer->hasVisibleDescendan t())
1115 break; 1143 break;
1116 1144
1117 layer->m_hasVisibleDescendant = true; 1145 layer->m_hasVisibleDescendant = true;
1118 layer->m_visibleDescendantStatusDirty = false; 1146 layer->m_visibleDescendantStatusDirty = false;
1119 } 1147 }
1120 } 1148 }
1121 1149
1122 void RenderLayer::updateDescendantDependentFlags(HashSet<const RenderObject*>* o utOfFlowDescendantContainingBlocks) 1150 // This method is called on all out of flow positioned layers. It simply walks
1151 // up to its containing block marking every layer it passes as having an
1152 // 'unclipped' descendant. The map is used to prevent wasted walking. If we
1153 // have already passed layer A heading towards containing block B, there's no
1154 // need to do it again; we can early out.
1155 void RenderLayer::updateHasUnclippedDescendant(RenderLayer::AncestorContainingBl ockMap& map)
Julien - ping for review 2013/05/06 22:38:26 Wouldn't checking ancestor->m_hasUnclippedDescenda
Ian Vollick 2013/05/08 16:00:07 I did some measurements and this is indeed prematu
1156 {
1157 ASSERT(renderer()->isOutOfFlowPositioned());
1158 if (!m_hasVisibleContent && !m_hasVisibleDescendant)
1159 return;
1160
1161 const RenderObject* containingBlock = renderer()->containingBlock();
1162 for (RenderLayer* ancestor = parent(); ancestor && ancestor->renderer() != c ontainingBlock; ancestor = ancestor->parent()) {
1163 AncestorContainingBlockMap::iterator it = map.find(ancestor);
1164 if (it == map.end()) {
1165 OwnPtr<HashSet<const RenderObject*> > containingBlocks = adoptPtr(ne w HashSet<const RenderObject*>);
1166 containingBlocks->add(containingBlock);
1167 map.add(ancestor, containingBlocks.release());
1168 } else if (!it->value->contains(containingBlock)) {
1169 it->value->add(containingBlock);
1170 } else {
1171 break;
1172 }
1173
1174 ancestor->m_hasUnclippedDescendant = true;
1175 }
1176 }
1177
1178 void RenderLayer::updateDescendantDependentFlags()
1123 { 1179 {
1124 if (m_visibleDescendantStatusDirty || m_hasSelfPaintingLayerDescendantDirty || m_hasOutOfFlowPositionedDescendantDirty) { 1180 if (m_visibleDescendantStatusDirty || m_hasSelfPaintingLayerDescendantDirty || m_hasOutOfFlowPositionedDescendantDirty) {
1125 const bool hadVisibleDescendant = m_hasVisibleDescendant;
1126 const bool hadOutOfFlowPositionedDescendant = m_hasOutOfFlowPositionedDe scendant;
1127
1128 m_hasVisibleDescendant = false; 1181 m_hasVisibleDescendant = false;
1129 m_hasSelfPaintingLayerDescendant = false; 1182 m_hasSelfPaintingLayerDescendant = false;
1130 m_hasOutOfFlowPositionedDescendant = false; 1183 m_hasOutOfFlowPositionedDescendant = false;
1131 1184
1132 HashSet<const RenderObject*> childOutOfFlowDescendantContainingBlocks;
1133 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin g()) { 1185 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin g()) {
1134 childOutOfFlowDescendantContainingBlocks.clear(); 1186 child->updateDescendantDependentFlags();
1135 child->updateDescendantDependentFlags(&childOutOfFlowDescendantConta iningBlocks);
1136
1137 bool childIsOutOfFlowPositioned = child->renderer() && child->render er()->isOutOfFlowPositioned();
1138 if (childIsOutOfFlowPositioned)
1139 childOutOfFlowDescendantContainingBlocks.add(child->renderer()-> containingBlock());
1140
1141 if (outOfFlowDescendantContainingBlocks) {
1142 HashSet<const RenderObject*>::const_iterator it = childOutOfFlow DescendantContainingBlocks.begin();
1143 for (; it != childOutOfFlowDescendantContainingBlocks.end(); ++i t)
1144 outOfFlowDescendantContainingBlocks->add(*it);
1145 }
1146 1187
1147 bool hasVisibleDescendant = child->m_hasVisibleContent || child->m_h asVisibleDescendant; 1188 bool hasVisibleDescendant = child->m_hasVisibleContent || child->m_h asVisibleDescendant;
1148 bool hasSelfPaintingLayerDescendant = child->isSelfPaintingLayer() | | child->hasSelfPaintingLayerDescendant(); 1189 bool hasSelfPaintingLayerDescendant = child->isSelfPaintingLayer() | | child->hasSelfPaintingLayerDescendant();
1149 bool hasOutOfFlowPositionedDescendant = hasVisibleDescendant && (!ch ildOutOfFlowDescendantContainingBlocks.isEmpty() || child->hasOutOfFlowPositione dDescendant()); 1190 bool hasOutOfFlowPositionedDescendant = child->renderer()->isOutOfFl owPositioned() || child->hasOutOfFlowPositionedDescendant();
1150 1191
1151 m_hasVisibleDescendant |= hasVisibleDescendant; 1192 m_hasVisibleDescendant |= hasVisibleDescendant;
1152 m_hasSelfPaintingLayerDescendant |= hasSelfPaintingLayerDescendant; 1193 m_hasSelfPaintingLayerDescendant |= hasSelfPaintingLayerDescendant;
1153 m_hasOutOfFlowPositionedDescendant |= hasOutOfFlowPositionedDescenda nt; 1194 m_hasOutOfFlowPositionedDescendant |= hasOutOfFlowPositionedDescenda nt;
1154 1195
1155 if (m_hasVisibleDescendant && m_hasSelfPaintingLayerDescendant && m_ hasOutOfFlowPositionedDescendant) 1196 if (m_hasVisibleDescendant && m_hasSelfPaintingLayerDescendant && ha sOutOfFlowPositionedDescendant)
1156 break; 1197 break;
1157 } 1198 }
1158 1199
1159 if (outOfFlowDescendantContainingBlocks && renderer())
1160 outOfFlowDescendantContainingBlocks->remove(renderer());
1161
1162 m_visibleDescendantStatusDirty = false; 1200 m_visibleDescendantStatusDirty = false;
1163 m_hasSelfPaintingLayerDescendantDirty = false; 1201 m_hasSelfPaintingLayerDescendantDirty = false;
1164 m_hasOutOfFlowPositionedDescendantDirty = false; 1202 m_hasOutOfFlowPositionedDescendantDirty = false;
1165
1166 if (m_hasVisibleDescendant != hadVisibleDescendant || m_hasOutOfFlowPosi tionedDescendant != hadOutOfFlowPositionedDescendant)
1167 updateNeedsCompositedScrolling();
1168 } 1203 }
1169 1204
1170 if (m_visibleContentStatusDirty) { 1205 if (m_visibleContentStatusDirty) {
1171 const bool hadVisibleContent = m_hasVisibleContent;
1172 if (renderer()->style()->visibility() == VISIBLE) 1206 if (renderer()->style()->visibility() == VISIBLE)
1173 m_hasVisibleContent = true; 1207 m_hasVisibleContent = true;
1174 else { 1208 else {
1175 // layer may be hidden but still have some visible content, check fo r this 1209 // layer may be hidden but still have some visible content, check fo r this
1176 m_hasVisibleContent = false; 1210 m_hasVisibleContent = false;
1177 RenderObject* r = renderer()->firstChild(); 1211 RenderObject* r = renderer()->firstChild();
1178 while (r) { 1212 while (r) {
1179 if (r->style()->visibility() == VISIBLE && !r->hasLayer()) { 1213 if (r->style()->visibility() == VISIBLE && !r->hasLayer()) {
1180 m_hasVisibleContent = true; 1214 m_hasVisibleContent = true;
1181 break; 1215 break;
1182 } 1216 }
1183 if (r->firstChild() && !r->hasLayer()) 1217 if (r->firstChild() && !r->hasLayer())
1184 r = r->firstChild(); 1218 r = r->firstChild();
1185 else if (r->nextSibling()) 1219 else if (r->nextSibling())
1186 r = r->nextSibling(); 1220 r = r->nextSibling();
1187 else { 1221 else {
1188 do { 1222 do {
1189 r = r->parent(); 1223 r = r->parent();
1190 if (r == renderer()) 1224 if (r == renderer())
1191 r = 0; 1225 r = 0;
1192 } while (r && !r->nextSibling()); 1226 } while (r && !r->nextSibling());
1193 if (r) 1227 if (r)
1194 r = r->nextSibling(); 1228 r = r->nextSibling();
1195 } 1229 }
1196 } 1230 }
1197 } 1231 }
1198 m_visibleContentStatusDirty = false; 1232 m_visibleContentStatusDirty = false;
1199 if (hadVisibleContent != m_hasVisibleContent)
1200 updateNeedsCompositedScrolling();
1201 } 1233 }
1202 } 1234 }
1203 1235
1204 void RenderLayer::dirty3DTransformedDescendantStatus() 1236 void RenderLayer::dirty3DTransformedDescendantStatus()
1205 { 1237 {
1206 RenderLayer* curr = ancestorStackingContainer(); 1238 RenderLayer* curr = ancestorStackingContainer();
1207 if (curr) 1239 if (curr)
1208 curr->m_3DTransformedDescendantStatusDirty = true; 1240 curr->m_3DTransformedDescendantStatusDirty = true;
1209 1241
1210 // This propagates up through preserve-3d hierarchies to the enclosing flatt ening layer. 1242 // This propagates up through preserve-3d hierarchies to the enclosing flatt ening layer.
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
1761 child->setParent(this); 1793 child->setParent(this);
1762 1794
1763 if (child->isNormalFlowOnly()) 1795 if (child->isNormalFlowOnly())
1764 dirtyNormalFlowList(); 1796 dirtyNormalFlowList();
1765 1797
1766 if (!child->isNormalFlowOnly() || child->firstChild()) { 1798 if (!child->isNormalFlowOnly() || child->firstChild()) {
1767 // Dirty the z-order list in which we are contained. The ancestorStackin gContainer() can be null in the 1799 // Dirty the z-order list in which we are contained. The ancestorStackin gContainer() can be null in the
1768 // case where we're building up generated content layers. This is ok, si nce the lists will start 1800 // case where we're building up generated content layers. This is ok, si nce the lists will start
1769 // off dirty in that case anyway. 1801 // off dirty in that case anyway.
1770 child->dirtyStackingContainerZOrderLists(); 1802 child->dirtyStackingContainerZOrderLists();
1771
1772 // Adding an out of flow positioned descendant can only affect
1773 // the opt-in decision for layers beneath and including our
1774 // containing block.
1775 RenderObject* containingBlock = child->renderer()->containingBlock();
1776 for (RenderLayer* layer = child; layer; layer = layer->parent()) {
1777 layer->updateNeedsCompositedScrolling();
1778 if (layer->renderer() == containingBlock)
1779 break;
1780 }
1781 } 1803 }
1782 1804
1783 child->updateDescendantDependentFlags(); 1805 child->updateDescendantDependentFlags();
1784 if (child->m_hasVisibleContent || child->m_hasVisibleDescendant) 1806 if (child->m_hasVisibleContent || child->m_hasVisibleDescendant)
1785 setAncestorChainHasVisibleDescendant(); 1807 setAncestorChainHasVisibleDescendant();
1786 1808
1787 if (child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant()) 1809 if (child->isSelfPaintingLayer() || child->hasSelfPaintingLayerDescendant())
1788 setAncestorChainHasSelfPaintingLayerDescendant(); 1810 setAncestorChainHasSelfPaintingLayerDescendant();
1789 1811
1790 if (child->renderer() && (child->renderer()->isOutOfFlowPositioned() || chil d->hasOutOfFlowPositionedDescendant())) 1812 if (child->renderer() && (child->renderer()->isOutOfFlowPositioned() || chil d->hasOutOfFlowPositionedDescendant())) {
Julien - ping for review 2013/05/06 22:38:26 child->renderer()->isOutOfFlowPositioned() || chil
Ian Vollick 2013/05/08 16:00:07 Done.
1791 setAncestorChainHasOutOfFlowPositionedDescendant(child->renderer()->cont ainingBlock()); 1813 // Now that the out of flow positioned descendant is in the tree, we
1814 // need to tell the compositor to reevaluate the compositing
1815 // requirements since we may be able to mark more layers as having
1816 // an 'unclipped' descendant.
1817 compositor()->setNeedsUpdateCompositingRequirementsState();
1818 setAncestorChainHasOutOfFlowPositionedDescendant();
1819 }
1792 1820
1793 compositor()->layerWasAdded(this, child); 1821 compositor()->layerWasAdded(this, child);
1794 } 1822 }
1795 1823
1796 RenderLayer* RenderLayer::removeChild(RenderLayer* oldChild) 1824 RenderLayer* RenderLayer::removeChild(RenderLayer* oldChild)
1797 { 1825 {
1798 if (!renderer()->documentBeingDestroyed()) 1826 if (!renderer()->documentBeingDestroyed())
1799 compositor()->layerWillBeRemoved(this, oldChild); 1827 compositor()->layerWillBeRemoved(this, oldChild);
1800 1828
1801 // remove the child 1829 // remove the child
1802 if (oldChild->previousSibling()) 1830 if (oldChild->previousSibling())
1803 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling()); 1831 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling());
1804 if (oldChild->nextSibling()) 1832 if (oldChild->nextSibling())
1805 oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling()) ; 1833 oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling()) ;
1806 1834
1807 if (m_first == oldChild) 1835 if (m_first == oldChild)
1808 m_first = oldChild->nextSibling(); 1836 m_first = oldChild->nextSibling();
1809 if (m_last == oldChild) 1837 if (m_last == oldChild)
1810 m_last = oldChild->previousSibling(); 1838 m_last = oldChild->previousSibling();
1811 1839
1812 if (oldChild->isNormalFlowOnly()) 1840 if (oldChild->isNormalFlowOnly())
1813 dirtyNormalFlowList(); 1841 dirtyNormalFlowList();
1814 if (!oldChild->isNormalFlowOnly() || oldChild->firstChild()) { 1842 if (!oldChild->isNormalFlowOnly() || oldChild->firstChild()) {
1815 // Dirty the z-order list in which we are contained. When called via th e 1843 // Dirty the z-order list in which we are contained. When called via th e
1816 // reattachment process in removeOnlyThisLayer, the layer may already be disconnected 1844 // reattachment process in removeOnlyThisLayer, the layer may already be disconnected
1817 // from the main layer tree, so we need to null-check the |stackingConta iner| value. 1845 // from the main layer tree, so we need to null-check the |stackingConta iner| value.
1818 oldChild->dirtyStackingContainerZOrderLists(); 1846 oldChild->dirtyStackingContainerZOrderLists();
1819
1820 // This could affect whether or not a layer has an out of flow
1821 // positioned descendant so we need to schedule some updates.
1822 // Removing an out of flow positioned descendant can only affect
1823 // the opt-in decision for layers beneath and including the old child's
1824 // containing block.
1825 RenderObject* containingBlock = oldChild->renderer()->containingBlock();
1826 for (RenderLayer* layer = this; layer; layer = layer->parent()) {
1827 layer->updateNeedsCompositedScrolling();
1828 if (layer->renderer() == containingBlock)
1829 break;
1830 }
1831 } 1847 }
1832 1848
1833 if ((oldChild->renderer() && oldChild->renderer()->isOutOfFlowPositioned()) || oldChild->hasOutOfFlowPositionedDescendant())
1834 dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus();
1835
1836 oldChild->setPreviousSibling(0); 1849 oldChild->setPreviousSibling(0);
1837 oldChild->setNextSibling(0); 1850 oldChild->setNextSibling(0);
1838 oldChild->setParent(0); 1851 oldChild->setParent(0);
1839 1852
1840 oldChild->updateDescendantDependentFlags(); 1853 oldChild->updateDescendantDependentFlags();
1854 if ((oldChild->renderer() && oldChild->renderer()->isOutOfFlowPositioned()) || oldChild->hasOutOfFlowPositionedDescendant()) {
1855 // It may now be the case that a layer no longer has an unclipped
1856 // descendant. Let the compositor know that it needs to reevaluate
1857 // its compositing requirements to check this.
1858 compositor()->setNeedsUpdateCompositingRequirementsState();
1859 dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus();
1860 }
1861
1841 if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant) 1862 if (oldChild->m_hasVisibleContent || oldChild->m_hasVisibleDescendant)
1842 dirtyAncestorChainVisibleDescendantStatus(); 1863 dirtyAncestorChainVisibleDescendantStatus();
1843 1864
1844 if (oldChild->isSelfPaintingLayer() || oldChild->hasSelfPaintingLayerDescend ant()) 1865 if (oldChild->isSelfPaintingLayer() || oldChild->hasSelfPaintingLayerDescend ant())
1845 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 1866 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
1846 1867
1847 return oldChild; 1868 return oldChild;
1848 } 1869 }
1849 1870
1850 void RenderLayer::removeOnlyThisLayer() 1871 void RenderLayer::removeOnlyThisLayer()
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 return true; 2080 return true;
2060 case ForceCompositedScrollingOff: 2081 case ForceCompositedScrollingOff:
2061 return false; 2082 return false;
2062 } 2083 }
2063 2084
2064 return m_needsCompositedScrolling; 2085 return m_needsCompositedScrolling;
2065 } 2086 }
2066 2087
2067 void RenderLayer::updateNeedsCompositedScrolling() 2088 void RenderLayer::updateNeedsCompositedScrolling()
2068 { 2089 {
2090 if (RenderLayer* ancestor = ancestorStackingContext())
2091 ancestor->updateDescendantsAreContiguousInStackingOrder();
2092
2069 bool needsCompositedScrolling = false; 2093 bool needsCompositedScrolling = false;
2070 2094
2071 FrameView* frameView = renderer()->view()->frameView(); 2095 FrameView* frameView = renderer()->view()->frameView();
2072 if (frameView && frameView->containsScrollableArea(this)) { 2096 if (frameView && frameView->containsScrollableArea(this)) {
2073 updateDescendantDependentFlags(); 2097 updateDescendantDependentFlags();
2074 2098
2075 bool forceUseCompositedScrolling = acceleratedCompositingForOverflowScro llEnabled() 2099 bool forceUseCompositedScrolling = acceleratedCompositingForOverflowScro llEnabled()
2076 && canBeStackingContainer() 2100 && canBeStackingContainer()
2077 && !hasOutOfFlowPositionedDescendant(); 2101 && !hasUnclippedDescendant();
2078 2102
2079 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING) 2103 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
2080 needsCompositedScrolling = forceUseCompositedScrolling || renderer()->st yle()->useTouchOverflowScrolling(); 2104 needsCompositedScrolling = forceUseCompositedScrolling || renderer()->st yle()->useTouchOverflowScrolling();
2081 #else 2105 #else
2082 needsCompositedScrolling = forceUseCompositedScrolling; 2106 needsCompositedScrolling = forceUseCompositedScrolling;
2083 #endif 2107 #endif
2084 // We gather a boolean value for use with Google UMA histograms to 2108 // We gather a boolean value for use with Google UMA histograms to
2085 // quantify the actual effects of a set of patches attempting to 2109 // quantify the actual effects of a set of patches attempting to
2086 // relax composited scrolling requirements, thereby increasing the 2110 // relax composited scrolling requirements, thereby increasing the
2087 // number of composited overflow divs. 2111 // number of composited overflow divs.
2088 if (acceleratedCompositingForOverflowScrollEnabled()) 2112 if (acceleratedCompositingForOverflowScrollEnabled())
2089 HistogramSupport::histogramEnumeration("Renderer.NeedsCompositedScro lling", needsCompositedScrolling, 2); 2113 HistogramSupport::histogramEnumeration("Renderer.NeedsCompositedScro lling", needsCompositedScrolling, 2);
2090 } 2114 }
2091 2115
2116 setNeedsCompositedScrolling(needsCompositedScrolling);
2117 }
2118
2119 void RenderLayer::setNeedsCompositedScrolling(bool needsCompositedScrolling)
2120 {
2092 if (m_needsCompositedScrolling == needsCompositedScrolling) 2121 if (m_needsCompositedScrolling == needsCompositedScrolling)
2093 return; 2122 return;
2094 2123
2095 m_needsCompositedScrolling = needsCompositedScrolling; 2124 m_needsCompositedScrolling = needsCompositedScrolling;
2096 2125
2097 // Note, the z-order lists may need to be rebuilt, but our code guarantees 2126 // Note, the z-order lists may need to be rebuilt, but our code guarantees
2098 // that we have not affected stacking, so we will not dirty 2127 // that we have not affected stacking, so we will not dirty
2099 // m_canBePromotedToStackingContainer for either us or our stacking context 2128 // m_canBePromotedToStackingContainer for either us or our stacking context
2100 // or container. 2129 // or container.
2101 didUpdateNeedsCompositedScrolling(); 2130 didUpdateNeedsCompositedScrolling();
(...skipping 3507 matching lines...) Expand 10 before | Expand all | Expand 10 after
5609 5638
5610 if (m_posZOrderList) 5639 if (m_posZOrderList)
5611 m_posZOrderList->clear(); 5640 m_posZOrderList->clear();
5612 if (m_negZOrderList) 5641 if (m_negZOrderList)
5613 m_negZOrderList->clear(); 5642 m_negZOrderList->clear();
5614 m_zOrderListsDirty = true; 5643 m_zOrderListsDirty = true;
5615 5644
5616 m_descendantsAreContiguousInStackingOrderDirty = true; 5645 m_descendantsAreContiguousInStackingOrderDirty = true;
5617 5646
5618 if (!renderer()->documentBeingDestroyed()) { 5647 if (!renderer()->documentBeingDestroyed()) {
5648 compositor()->setNeedsUpdateCompositingRequirementsState();
5619 compositor()->setCompositingLayersNeedRebuild(); 5649 compositor()->setCompositingLayersNeedRebuild();
5620 if (acceleratedCompositingForOverflowScrollEnabled()) 5650 if (acceleratedCompositingForOverflowScrollEnabled())
5621 compositor()->setShouldReevaluateCompositingAfterLayout(); 5651 compositor()->setShouldReevaluateCompositingAfterLayout();
5622 } 5652 }
5623 } 5653 }
5624 5654
5625 void RenderLayer::dirtyStackingContainerZOrderLists() 5655 void RenderLayer::dirtyStackingContainerZOrderLists()
5626 { 5656 {
5627 RenderLayer* stackingContainer = this->ancestorStackingContainer(); 5657 RenderLayer* stackingContainer = this->ancestorStackingContainer();
5628 if (stackingContainer) 5658 if (stackingContainer)
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
5747 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin g()) { 5777 for (RenderLayer* child = firstChild(); child; child = child->nextSiblin g()) {
5748 // Ignore reflections. 5778 // Ignore reflections.
5749 if (!m_reflection || reflectionLayer() != child) 5779 if (!m_reflection || reflectionLayer() != child)
5750 child->collectLayers(includeHiddenLayers, behavior, posBuffer, n egBuffer, layerToForceAsStackingContainer); 5780 child->collectLayers(includeHiddenLayers, behavior, posBuffer, n egBuffer, layerToForceAsStackingContainer);
5751 } 5781 }
5752 } 5782 }
5753 } 5783 }
5754 5784
5755 void RenderLayer::updateLayerListsIfNeeded() 5785 void RenderLayer::updateLayerListsIfNeeded()
5756 { 5786 {
5757 bool shouldUpdateDescendantsAreContiguousInStackingOrder = acceleratedCompos itingForOverflowScrollEnabled() && isStackingContext() && (m_zOrderListsDirty || m_normalFlowListDirty) && m_descendantsAreContiguousInStackingOrderDirty;
5758 updateZOrderLists(); 5787 updateZOrderLists();
5759 updateNormalFlowList(); 5788 updateNormalFlowList();
5760 5789
5761 if (RenderLayer* reflectionLayer = this->reflectionLayer()) { 5790 if (RenderLayer* reflectionLayer = this->reflectionLayer()) {
5762 reflectionLayer->updateZOrderLists(); 5791 reflectionLayer->updateZOrderLists();
5763 reflectionLayer->updateNormalFlowList(); 5792 reflectionLayer->updateNormalFlowList();
5764 } 5793 }
5765
5766 if (shouldUpdateDescendantsAreContiguousInStackingOrder) {
5767 updateDescendantsAreContiguousInStackingOrder();
5768 // The above function can cause us to update m_needsCompositedScrolling
5769 // and dirty our layer lists. Refresh them if necessary.
5770 updateZOrderLists();
5771 updateNormalFlowList();
5772 }
5773 } 5794 }
5774 5795
5775 void RenderLayer::repaintIncludingDescendants() 5796 void RenderLayer::repaintIncludingDescendants()
5776 { 5797 {
5777 renderer()->repaint(); 5798 renderer()->repaint();
5778 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) 5799 for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling())
5779 curr->repaintIncludingDescendants(); 5800 curr->repaintIncludingDescendants();
5780 } 5801 }
5781 5802
5782 void RenderLayer::setBackingNeedsRepaint() 5803 void RenderLayer::setBackingNeedsRepaint()
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
5935 return true; 5956 return true;
5936 5957
5937 if (hasVisibleBoxDecorations()) 5958 if (hasVisibleBoxDecorations())
5938 return true; 5959 return true;
5939 5960
5940 return false; 5961 return false;
5941 } 5962 }
5942 5963
5943 void RenderLayer::updateVisibilityAfterStyleChange(const RenderStyle* oldStyle) 5964 void RenderLayer::updateVisibilityAfterStyleChange(const RenderStyle* oldStyle)
5944 { 5965 {
5945 EVisibility oldVisibility = oldStyle ? oldStyle->visibility() : VISIBLE; 5966 if (!oldStyle || (oldStyle->visibility() != renderer()->style()->visibility( )))
5946 if (oldVisibility == renderer()->style()->visibility() || !renderer()->isOut OfFlowPositioned()) 5967 compositor()->setNeedsUpdateCompositingRequirementsState();
5947 return;
5948
5949 if (renderer()->style()->visibility() == VISIBLE)
5950 setAncestorChainHasOutOfFlowPositionedDescendant(renderer()->containingB lock());
5951 else
5952 dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus();
5953 } 5968 }
5954 5969
5955 void RenderLayer::updateStackingContextsAfterStyleChange(const RenderStyle* oldS tyle) 5970 void RenderLayer::updateStackingContextsAfterStyleChange(const RenderStyle* oldS tyle)
5956 { 5971 {
5957 bool wasStackingContext = oldStyle ? isStackingContext(oldStyle) : false; 5972 bool wasStackingContext = oldStyle ? isStackingContext(oldStyle) : false;
5958 EVisibility oldVisibility = oldStyle ? oldStyle->visibility() : VISIBLE; 5973 EVisibility oldVisibility = oldStyle ? oldStyle->visibility() : VISIBLE;
5959 int oldZIndex = oldStyle ? oldStyle->zIndex() : 0; 5974 int oldZIndex = oldStyle ? oldStyle->zIndex() : 0;
5960 5975
5961 // FIXME: RenderLayer already handles visibility changes through our visibli ty dirty bits. This logic could 5976 // FIXME: RenderLayer already handles visibility changes through our visibli ty dirty bits. This logic could
5962 // likely be folded along with the rest. 5977 // likely be folded along with the rest.
5963 bool isStackingContext = this->isStackingContext(); 5978 bool isStackingContext = this->isStackingContext();
5964 if (isStackingContext == wasStackingContext && oldVisibility == renderer()-> style()->visibility() && oldZIndex == renderer()->style()->zIndex()) 5979 if (isStackingContext == wasStackingContext && oldVisibility == renderer()-> style()->visibility() && oldZIndex == renderer()->style()->zIndex())
5965 return; 5980 return;
5966 5981
5967 dirtyStackingContainerZOrderLists(); 5982 dirtyStackingContainerZOrderLists();
5968 5983
5969 if (isStackingContainer()) 5984 if (isStackingContainer())
5970 dirtyZOrderLists(); 5985 dirtyZOrderLists();
5971 else 5986 else
5972 clearZOrderLists(); 5987 clearZOrderLists();
5973 5988
5974 updateNeedsCompositedScrolling(); 5989 compositor()->setNeedsUpdateCompositingRequirementsState();
5975 } 5990 }
5976 5991
5977 static bool overflowRequiresScrollbar(EOverflow overflow) 5992 static bool overflowRequiresScrollbar(EOverflow overflow)
5978 { 5993 {
5979 return overflow == OSCROLL; 5994 return overflow == OSCROLL;
5980 } 5995 }
5981 5996
5982 static bool overflowDefinesAutomaticScrollbar(EOverflow overflow) 5997 static bool overflowDefinesAutomaticScrollbar(EOverflow overflow)
5983 { 5998 {
5984 return overflow == OAUTO || overflow == OOVERLAY; 5999 return overflow == OAUTO || overflow == OOVERLAY;
(...skipping 28 matching lines...) Expand all
6013 6028
6014 if (needsVerticalScrollbar && oldStyle && oldStyle->overflowY() == OSCROLL & & overflowY != OSCROLL) { 6029 if (needsVerticalScrollbar && oldStyle && oldStyle->overflowY() == OSCROLL & & overflowY != OSCROLL) {
6015 ASSERT(hasVerticalScrollbar()); 6030 ASSERT(hasVerticalScrollbar());
6016 m_vBar->setEnabled(true); 6031 m_vBar->setEnabled(true);
6017 } 6032 }
6018 6033
6019 if (!m_scrollDimensionsDirty) 6034 if (!m_scrollDimensionsDirty)
6020 updateScrollableAreaSet(hasScrollableHorizontalOverflow() || hasScrollab leVerticalOverflow()); 6035 updateScrollableAreaSet(hasScrollableHorizontalOverflow() || hasScrollab leVerticalOverflow());
6021 } 6036 }
6022 6037
6023 void RenderLayer::setAncestorChainHasOutOfFlowPositionedDescendant(RenderObject* containingBlock)
6024 {
6025 for (RenderLayer* layer = this; layer; layer = layer->parent()) {
6026 if (!layer->m_hasOutOfFlowPositionedDescendantDirty && layer->hasOutOfFl owPositionedDescendant())
6027 break;
6028
6029 layer->m_hasOutOfFlowPositionedDescendantDirty = false;
6030 layer->m_hasOutOfFlowPositionedDescendant = true;
6031 layer->updateNeedsCompositedScrolling();
6032
6033 if (layer->renderer() && layer->renderer() == containingBlock)
6034 break;
6035 }
6036 }
6037
6038 void RenderLayer::dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus()
6039 {
6040 if (m_hasOutOfFlowPositionedDescendant) {
6041 m_hasOutOfFlowPositionedDescendantDirty = true;
6042 // FIXME It would be nice to avoid this when we clean up render layer
6043 // updating. We shouldn't have to update the composited scrolling state
6044 // nearly as frequently if all the updates happen in a single, well
6045 // defined phase.
6046 updateNeedsCompositedScrolling();
6047 }
6048
6049 if (parent())
6050 parent()->dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus();
6051 }
6052
6053 void RenderLayer::updateOutOfFlowPositioned(const RenderStyle* oldStyle) 6038 void RenderLayer::updateOutOfFlowPositioned(const RenderStyle* oldStyle)
6054 { 6039 {
6040 if (oldStyle && (renderer()->style()->position() == oldStyle->position()))
6041 return;
6042
6055 bool wasOutOfFlowPositioned = oldStyle && (oldStyle->position() == AbsoluteP osition || oldStyle->position() == FixedPosition); 6043 bool wasOutOfFlowPositioned = oldStyle && (oldStyle->position() == AbsoluteP osition || oldStyle->position() == FixedPosition);
6056 bool isOutOfFlowPositioned = renderer()->isOutOfFlowPositioned(); 6044 bool isOutOfFlowPositioned = renderer()->isOutOfFlowPositioned();
6057 if (parent() && isOutOfFlowPositioned != wasOutOfFlowPositioned) { 6045 if (!wasOutOfFlowPositioned && !isOutOfFlowPositioned)
6058 if (isOutOfFlowPositioned) 6046 return;
6059 parent()->setAncestorChainHasOutOfFlowPositionedDescendant(renderer( )->containingBlock()); 6047
6060 else 6048 // Even if the layer remains out-of-flow, a change to this property
6061 parent()->dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus() ; 6049 // will likely change its containing block. We must clear these bits
6050 // so that they can be set properly by the RenderLayerCompositor.
6051 for (RenderLayer* ancestor = parent(); ancestor; ancestor = ancestor->parent ())
6052 ancestor->m_hasUnclippedDescendant = false;
6053
6054 // Ensures that we reset the above bits correctly.
6055 compositor()->setNeedsUpdateCompositingRequirementsState();
6056
6057 if (wasOutOfFlowPositioned && isOutOfFlowPositioned)
6058 return;
6059
6060 if (isOutOfFlowPositioned) {
6061 setAncestorChainHasOutOfFlowPositionedDescendant();
6062 compositor()->addOutOfFlowPositionedLayer(this);
6063 } else {
6064 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
6065 compositor()->removeOutOfFlowPositionedLayer(this);
6062 } 6066 }
6063 } 6067 }
6064 6068
6065 static bool hasOrHadFilters(const RenderStyle* oldStyle, const RenderStyle* newS tyle) 6069 static bool hasOrHadFilters(const RenderStyle* oldStyle, const RenderStyle* newS tyle)
6066 { 6070 {
6067 ASSERT(newStyle); 6071 ASSERT(newStyle);
6068 return (oldStyle && oldStyle->hasFilter()) || newStyle->hasFilter(); 6072 return (oldStyle && oldStyle->hasFilter()) || newStyle->hasFilter();
6069 } 6073 }
6070 6074
6071 inline bool RenderLayer::needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const RenderStyle* newStyle) const 6075 inline bool RenderLayer::needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const RenderStyle* newStyle) const
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
6204 6208
6205 FrameView* frameView = frame->view(); 6209 FrameView* frameView = frame->view();
6206 if (!frameView) 6210 if (!frameView)
6207 return; 6211 return;
6208 6212
6209 bool isVisibleToHitTest = renderer()->visibleToHitTesting(); 6213 bool isVisibleToHitTest = renderer()->visibleToHitTesting();
6210 if (HTMLFrameOwnerElement* owner = frame->ownerElement()) 6214 if (HTMLFrameOwnerElement* owner = frame->ownerElement())
6211 isVisibleToHitTest &= owner->renderer() && owner->renderer()->visibleToH itTesting(); 6215 isVisibleToHitTest &= owner->renderer() && owner->renderer()->visibleToH itTesting();
6212 6216
6213 bool updatedScrollableAreaSet = false; 6217 bool updatedScrollableAreaSet = false;
6214 if (hasOverflow && isVisibleToHitTest) 6218 if (hasOverflow && isVisibleToHitTest) {
6215 updatedScrollableAreaSet = frameView->addScrollableArea(this); 6219 updatedScrollableAreaSet = frameView->addScrollableArea(this);
6216 else 6220 compositor()->setNeedsUpdateCompositingRequirementsState();
6221 } else {
6217 updatedScrollableAreaSet = frameView->removeScrollableArea(this); 6222 updatedScrollableAreaSet = frameView->removeScrollableArea(this);
6218 6223 setNeedsCompositedScrolling(false);
6219 if (updatedScrollableAreaSet) 6224 }
6220 updateNeedsCompositedScrolling();
6221 } 6225 }
6222 6226
6223 void RenderLayer::updateScrollCornerStyle() 6227 void RenderLayer::updateScrollCornerStyle()
6224 { 6228 {
6225 RenderObject* actualRenderer = rendererForScrollbar(renderer()); 6229 RenderObject* actualRenderer = rendererForScrollbar(renderer());
6226 RefPtr<RenderStyle> corner = renderer()->hasOverflowClip() ? actualRenderer- >getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->st yle()) : PassRefPtr<RenderStyle>(0); 6230 RefPtr<RenderStyle> corner = renderer()->hasOverflowClip() ? actualRenderer- >getUncachedPseudoStyle(PseudoStyleRequest(SCROLLBAR_CORNER), actualRenderer->st yle()) : PassRefPtr<RenderStyle>(0);
6227 if (corner) { 6231 if (corner) {
6228 if (!m_scrollCorner) { 6232 if (!m_scrollCorner) {
6229 m_scrollCorner = RenderScrollbarPart::createAnonymous(renderer()->do cument()); 6233 m_scrollCorner = RenderScrollbarPart::createAnonymous(renderer()->do cument());
6230 m_scrollCorner->setParent(renderer()); 6234 m_scrollCorner->setParent(renderer());
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
6461 } 6465 }
6462 } 6466 }
6463 6467
6464 void showLayerTree(const WebCore::RenderObject* renderer) 6468 void showLayerTree(const WebCore::RenderObject* renderer)
6465 { 6469 {
6466 if (!renderer) 6470 if (!renderer)
6467 return; 6471 return;
6468 showLayerTree(renderer->enclosingLayer()); 6472 showLayerTree(renderer->enclosingLayer());
6469 } 6473 }
6470 #endif 6474 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698