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 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1133 child->setNextSibling(beforeChild); | 1133 child->setNextSibling(beforeChild); |
1134 ASSERT(beforeChild != child); | 1134 ASSERT(beforeChild != child); |
1135 } else { | 1135 } else { |
1136 setLastChild(child); | 1136 setLastChild(child); |
1137 } | 1137 } |
1138 | 1138 |
1139 child->m_parent = this; | 1139 child->m_parent = this; |
1140 | 1140 |
1141 setNeedsCompositingInputsUpdate(); | 1141 setNeedsCompositingInputsUpdate(); |
1142 | 1142 |
1143 if (!child->stackingNode()->isTreatedAsStackingContextForPainting()) | 1143 if (!child->stackingNode()->isTreatedAsStackingContextForPainting()) { |
dsinclair
2015/06/24 15:22:41
Any reason to not have this as a single if stateme
Julien - ping for review
2015/06/24 16:51:57
None really.
| |
1144 m_stackingNode->dirtyNormalFlowList(); | 1144 if (!layoutObject()->documentBeingDestroyed()) |
1145 compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree ); | |
1146 } | |
1145 | 1147 |
1146 if (child->stackingNode()->isTreatedAsStackingContextForPainting() || child- >firstChild()) { | 1148 if (child->stackingNode()->isTreatedAsStackingContextForPainting() || child- >firstChild()) { |
1147 // Dirty the z-order list in which we are contained. The ancestorStackin gContextNode() can be null in the | 1149 // Dirty the z-order list in which we are contained. The ancestorStackin gContextNode() can be null in the |
1148 // case where we're building up generated content layers. This is ok, si nce the lists will start | 1150 // case where we're building up generated content layers. This is ok, si nce the lists will start |
1149 // off dirty in that case anyway. | 1151 // off dirty in that case anyway. |
1150 child->stackingNode()->dirtyStackingContextZOrderLists(); | 1152 child->stackingNode()->dirtyStackingContextZOrderLists(); |
1151 } | 1153 } |
1152 | 1154 |
1153 dirtyAncestorChainVisibleDescendantStatus(); | 1155 dirtyAncestorChainVisibleDescendantStatus(); |
1154 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); | 1156 dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
1155 | 1157 |
1156 child->updateDescendantDependentFlags(); | 1158 child->updateDescendantDependentFlags(); |
1157 } | 1159 } |
1158 | 1160 |
1159 DeprecatedPaintLayer* DeprecatedPaintLayer::removeChild(DeprecatedPaintLayer* ol dChild) | 1161 DeprecatedPaintLayer* DeprecatedPaintLayer::removeChild(DeprecatedPaintLayer* ol dChild) |
1160 { | 1162 { |
1161 if (oldChild->previousSibling()) | 1163 if (oldChild->previousSibling()) |
1162 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling()); | 1164 oldChild->previousSibling()->setNextSibling(oldChild->nextSibling()); |
1163 if (oldChild->nextSibling()) | 1165 if (oldChild->nextSibling()) |
1164 oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling()) ; | 1166 oldChild->nextSibling()->setPreviousSibling(oldChild->previousSibling()) ; |
1165 | 1167 |
1166 if (m_first == oldChild) | 1168 if (m_first == oldChild) |
1167 m_first = oldChild->nextSibling(); | 1169 m_first = oldChild->nextSibling(); |
1168 if (m_last == oldChild) | 1170 if (m_last == oldChild) |
1169 m_last = oldChild->previousSibling(); | 1171 m_last = oldChild->previousSibling(); |
1170 | 1172 |
1171 if (!oldChild->stackingNode()->isTreatedAsStackingContextForPainting()) | 1173 if (!oldChild->stackingNode()->isTreatedAsStackingContextForPainting()) { |
1172 m_stackingNode->dirtyNormalFlowList(); | 1174 if (!layoutObject()->documentBeingDestroyed()) |
1175 compositor()->setNeedsCompositingUpdate(CompositingUpdateRebuildTree ); | |
1176 } | |
1177 | |
1173 if (oldChild->stackingNode()->isTreatedAsStackingContextForPainting() || old Child->firstChild()) { | 1178 if (oldChild->stackingNode()->isTreatedAsStackingContextForPainting() || old Child->firstChild()) { |
1174 // Dirty the z-order list in which we are contained. When called via th e | 1179 // Dirty the z-order list in which we are contained. When called via th e |
1175 // reattachment process in removeOnlyThisLayer, the layer may already be disconnected | 1180 // reattachment process in removeOnlyThisLayer, the layer may already be disconnected |
1176 // from the main layer tree, so we need to null-check the | 1181 // from the main layer tree, so we need to null-check the |
1177 // |stackingContext| value. | 1182 // |stackingContext| value. |
1178 oldChild->stackingNode()->dirtyStackingContextZOrderLists(); | 1183 oldChild->stackingNode()->dirtyStackingContextZOrderLists(); |
1179 } | 1184 } |
1180 | 1185 |
1181 if (layoutObject()->style()->visibility() != VISIBLE) | 1186 if (layoutObject()->style()->visibility() != VISIBLE) |
1182 dirtyVisibleContentStatus(); | 1187 dirtyVisibleContentStatus(); |
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2412 if (paintsWithFilters() && layoutObject()->style()->filter().hasFilterThatAf fectsOpacity()) | 2417 if (paintsWithFilters() && layoutObject()->style()->filter().hasFilterThatAf fectsOpacity()) |
2413 return false; | 2418 return false; |
2414 | 2419 |
2415 // FIXME: Handle simple transforms. | 2420 // FIXME: Handle simple transforms. |
2416 if (paintsWithTransform(PaintBehaviorNormal)) | 2421 if (paintsWithTransform(PaintBehaviorNormal)) |
2417 return false; | 2422 return false; |
2418 | 2423 |
2419 // FIXME: Remove this check. | 2424 // FIXME: Remove this check. |
2420 // This function should not be called when layer-lists are dirty. | 2425 // This function should not be called when layer-lists are dirty. |
2421 // It is somehow getting triggered during style update. | 2426 // It is somehow getting triggered during style update. |
2422 if (m_stackingNode->zOrderListsDirty() || m_stackingNode->normalFlowListDirt y()) | 2427 if (m_stackingNode->zOrderListsDirty()) |
2423 return false; | 2428 return false; |
2424 | 2429 |
2425 // FIXME: We currently only check the immediate layoutObject, | 2430 // FIXME: We currently only check the immediate layoutObject, |
2426 // which will miss many cases. | 2431 // which will miss many cases. |
2427 if (layoutObject()->backgroundIsKnownToBeOpaqueInRect(localRect)) | 2432 if (layoutObject()->backgroundIsKnownToBeOpaqueInRect(localRect)) |
2428 return true; | 2433 return true; |
2429 | 2434 |
2430 // We can't consult child layers if we clip, since they might cover | 2435 // We can't consult child layers if we clip, since they might cover |
2431 // parts of the rect that are clipped out. | 2436 // parts of the rect that are clipped out. |
2432 if (layoutObject()->hasOverflowClip()) | 2437 if (layoutObject()->hasOverflowClip()) |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2755 | 2760 |
2756 void showLayerTree(const blink::LayoutObject* layoutObject) | 2761 void showLayerTree(const blink::LayoutObject* layoutObject) |
2757 { | 2762 { |
2758 if (!layoutObject) { | 2763 if (!layoutObject) { |
2759 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2764 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
2760 return; | 2765 return; |
2761 } | 2766 } |
2762 showLayerTree(layoutObject->enclosingLayer()); | 2767 showLayerTree(layoutObject->enclosingLayer()); |
2763 } | 2768 } |
2764 #endif | 2769 #endif |
OLD | NEW |