OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009, 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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 void clearBlockSelectionGapsBounds(); | 484 void clearBlockSelectionGapsBounds(); |
485 void repaintBlockSelectionGaps(); | 485 void repaintBlockSelectionGaps(); |
486 | 486 |
487 // A stacking context is a layer that has a non-auto z-index. | 487 // A stacking context is a layer that has a non-auto z-index. |
488 bool isStackingContext() const { return isStackingContext(renderer()->style(
)); } | 488 bool isStackingContext() const { return isStackingContext(renderer()->style(
)); } |
489 | 489 |
490 // A stacking container can have z-order lists. All stacking contexts are | 490 // A stacking container can have z-order lists. All stacking contexts are |
491 // stacking containers, but the converse is not true. Layers that use | 491 // stacking containers, but the converse is not true. Layers that use |
492 // composited scrolling are stacking containers, but they may not | 492 // composited scrolling are stacking containers, but they may not |
493 // necessarily be stacking contexts. | 493 // necessarily be stacking contexts. |
494 bool isStackingContainer() const { return isStackingContext() || needsCompos
itedScrolling(); } | 494 bool isStackingContainer(bool allowDirty = false) const { return isStackingC
ontext() || needsCompositedScrolling(allowDirty); } |
495 | 495 |
496 // Gets the enclosing stacking container for this layer, excluding this | 496 // Gets the enclosing stacking container for this layer, excluding this |
497 // layer itself. | 497 // layer itself. |
498 RenderLayer* stackingContainer() const; | 498 RenderLayer* stackingContainer(bool allowDirty = false) const; |
499 | 499 |
500 // Gets the enclosing stacking container for this layer, possibly the layer | 500 // Gets the enclosing stacking container for this layer, possibly the layer |
501 // itself, if it is a stacking container. | 501 // itself, if it is a stacking container. |
502 RenderLayer* enclosingStackingContainer() { return isStackingContainer() ? t
his : stackingContainer(); } | 502 RenderLayer* enclosingStackingContainer() { return isStackingContainer() ? t
his : stackingContainer(); } |
503 | 503 |
504 void dirtyZOrderLists(); | 504 void dirtyZOrderLists(); |
505 void dirtyStackingContainerZOrderLists(); | 505 void dirtyStackingContainerZOrderLists(); |
506 | 506 |
507 Vector<RenderLayer*>* posZOrderList() const | 507 Vector<RenderLayer*>* posZOrderList() const |
508 { | 508 { |
509 ASSERT(!m_zOrderListsDirty); | 509 ASSERT(!m_zOrderListsDirty); |
| 510 ASSERT(!m_hasOutOfFlowPositionedDescendantDirty); |
| 511 ASSERT(!m_descendantsAreContiguousInStackingOrderDirty); |
510 ASSERT(isStackingContainer() || !m_posZOrderList); | 512 ASSERT(isStackingContainer() || !m_posZOrderList); |
511 return m_posZOrderList.get(); | 513 return m_posZOrderList.get(); |
512 } | 514 } |
513 | 515 |
514 bool hasNegativeZOrderList() const { return negZOrderList() && negZOrderList
()->size(); } | 516 bool hasNegativeZOrderList() const { return negZOrderList() && negZOrderList
()->size(); } |
515 | 517 |
516 Vector<RenderLayer*>* negZOrderList() const | 518 Vector<RenderLayer*>* negZOrderList() const |
517 { | 519 { |
518 ASSERT(!m_zOrderListsDirty); | 520 ASSERT(!m_zOrderListsDirty); |
| 521 ASSERT(!m_hasOutOfFlowPositionedDescendantDirty); |
| 522 ASSERT(!m_descendantsAreContiguousInStackingOrderDirty); |
519 ASSERT(isStackingContainer() || !m_negZOrderList); | 523 ASSERT(isStackingContainer() || !m_negZOrderList); |
520 return m_negZOrderList.get(); | 524 return m_negZOrderList.get(); |
521 } | 525 } |
522 | 526 |
523 void dirtyNormalFlowList(); | 527 void dirtyNormalFlowList(); |
524 Vector<RenderLayer*>* normalFlowList() const { ASSERT(!m_normalFlowListDirty
); return m_normalFlowList.get(); } | 528 Vector<RenderLayer*>* normalFlowList() const { ASSERT(!m_normalFlowListDirty
); return m_normalFlowList.get(); } |
525 | 529 |
526 // Update our normal and z-index lists. | 530 // Update our normal and z-index lists. |
527 void updateLayerListsIfNeeded(); | 531 void updateLayerListsIfNeeded(); |
528 | 532 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 bool isComposited() const { return m_backing != 0; } | 754 bool isComposited() const { return m_backing != 0; } |
751 bool hasCompositedMask() const; | 755 bool hasCompositedMask() const; |
752 RenderLayerBacking* backing() const { return m_backing.get(); } | 756 RenderLayerBacking* backing() const { return m_backing.get(); } |
753 RenderLayerBacking* ensureBacking(); | 757 RenderLayerBacking* ensureBacking(); |
754 void clearBacking(bool layerBeingDestroyed = false); | 758 void clearBacking(bool layerBeingDestroyed = false); |
755 virtual GraphicsLayer* layerForScrolling() const; | 759 virtual GraphicsLayer* layerForScrolling() const; |
756 virtual GraphicsLayer* layerForHorizontalScrollbar() const; | 760 virtual GraphicsLayer* layerForHorizontalScrollbar() const; |
757 virtual GraphicsLayer* layerForVerticalScrollbar() const; | 761 virtual GraphicsLayer* layerForVerticalScrollbar() const; |
758 virtual GraphicsLayer* layerForScrollCorner() const; | 762 virtual GraphicsLayer* layerForScrollCorner() const; |
759 virtual bool usesCompositedScrolling() const OVERRIDE; | 763 virtual bool usesCompositedScrolling() const OVERRIDE; |
760 bool needsCompositedScrolling() const; | 764 bool needsCompositedScrolling(bool allowDirty = false) const; |
761 bool needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const
RenderStyle* newStyle) const; | 765 bool needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const
RenderStyle* newStyle) const; |
762 bool needsCompositingLayersRebuiltForOverflow(const RenderStyle* oldStyle, c
onst RenderStyle* newStyle) const; | 766 bool needsCompositingLayersRebuiltForOverflow(const RenderStyle* oldStyle, c
onst RenderStyle* newStyle) const; |
763 #if ENABLE(CSS_FILTERS) | 767 #if ENABLE(CSS_FILTERS) |
764 bool needsCompositingLayersRebuiltForFilters(const RenderStyle* oldStyle, co
nst RenderStyle* newStyle, bool didPaintWithFilters) const; | 768 bool needsCompositingLayersRebuiltForFilters(const RenderStyle* oldStyle, co
nst RenderStyle* newStyle, bool didPaintWithFilters) const; |
765 #else // !ENABLE(CSS_FILTERS) | 769 #else // !ENABLE(CSS_FILTERS) |
766 bool needsCompositingLayersRebuiltForFilters(const RenderStyle*, const Rende
rStyle*, bool) const { return false; } | 770 bool needsCompositingLayersRebuiltForFilters(const RenderStyle*, const Rende
rStyle*, bool) const { return false; } |
767 #endif // !ENABLE(CSS_FILTERS) | 771 #endif // !ENABLE(CSS_FILTERS) |
768 | 772 |
769 bool paintsWithTransparency(PaintBehavior paintBehavior) const | 773 bool paintsWithTransparency(PaintBehavior paintBehavior) const |
770 { | 774 { |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 void computeRepaintRectsIncludingDescendants(); | 861 void computeRepaintRectsIncludingDescendants(); |
858 void clearRepaintRects(); | 862 void clearRepaintRects(); |
859 | 863 |
860 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect&
paintDirtyRect, const ClipRect&, | 864 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect&
paintDirtyRect, const ClipRect&, |
861 BorderRadiusClippingRule = IncludeSelfForBorderRadius); | 865 BorderRadiusClippingRule = IncludeSelfForBorderRadius); |
862 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C
lipRect&); | 866 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C
lipRect&); |
863 | 867 |
864 bool shouldRepaintAfterLayout() const; | 868 bool shouldRepaintAfterLayout() const; |
865 | 869 |
866 void updateSelfPaintingLayer(); | 870 void updateSelfPaintingLayer(); |
| 871 void updateIsNormalFlowOnly(); |
867 void updateStackingContextsAfterStyleChange(const RenderStyle* oldStyle); | 872 void updateStackingContextsAfterStyleChange(const RenderStyle* oldStyle); |
868 | 873 |
869 void updateScrollbarsAfterStyleChange(const RenderStyle* oldStyle); | 874 void updateScrollbarsAfterStyleChange(const RenderStyle* oldStyle); |
870 void updateScrollbarsAfterLayout(); | 875 void updateScrollbarsAfterLayout(); |
871 | 876 |
872 void setAncestorChainHasOutOfFlowPositionedDescendant(RenderObject* containi
ngBlock); | 877 void setAncestorChainHasOutOfFlowPositionedDescendant(RenderObject* containi
ngBlock); |
873 void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); | 878 void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); |
874 void updateOutOfFlowPositioned(const RenderStyle* oldStyle); | 879 void updateOutOfFlowPositioned(const RenderStyle* oldStyle); |
875 | 880 |
876 void updateNeedsCompositedScrolling(); | 881 void updateNeedsCompositedScrolling(); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1140 // stacking context. | 1145 // stacking context. |
1141 bool m_hasOutOfFlowPositionedDescendant : 1; | 1146 bool m_hasOutOfFlowPositionedDescendant : 1; |
1142 bool m_hasOutOfFlowPositionedDescendantDirty : 1; | 1147 bool m_hasOutOfFlowPositionedDescendantDirty : 1; |
1143 | 1148 |
1144 bool m_needsCompositedScrolling : 1; | 1149 bool m_needsCompositedScrolling : 1; |
1145 | 1150 |
1146 // If this is true, then no non-descendant appears between any of our | 1151 // If this is true, then no non-descendant appears between any of our |
1147 // descendants in stacking order. This is one of the requirements of being | 1152 // descendants in stacking order. This is one of the requirements of being |
1148 // able to safely become a stacking context. | 1153 // able to safely become a stacking context. |
1149 bool m_descendantsAreContiguousInStackingOrder : 1; | 1154 bool m_descendantsAreContiguousInStackingOrder : 1; |
| 1155 bool m_descendantsAreContiguousInStackingOrderDirty : 1; |
1150 | 1156 |
1151 const bool m_isRootLayer : 1; | 1157 const bool m_isRootLayer : 1; |
1152 | 1158 |
1153 bool m_usedTransparency : 1; // Tracks whether we need to close a transparen
t layer, i.e., whether | 1159 bool m_usedTransparency : 1; // Tracks whether we need to close a transparen
t layer, i.e., whether |
1154 // we ended up painting this layer or any desce
ndants (and therefore need to | 1160 // we ended up painting this layer or any desce
ndants (and therefore need to |
1155 // blend). | 1161 // blend). |
1156 bool m_paintingInsideReflection : 1; // A state bit tracking if we are pain
ting inside a replica. | 1162 bool m_paintingInsideReflection : 1; // A state bit tracking if we are pain
ting inside a replica. |
1157 bool m_inOverflowRelayout : 1; | 1163 bool m_inOverflowRelayout : 1; |
1158 unsigned m_repaintStatus : 2; // RepaintStatus | 1164 unsigned m_repaintStatus : 2; // RepaintStatus |
1159 | 1165 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 | 1312 |
1307 } // namespace WebCore | 1313 } // namespace WebCore |
1308 | 1314 |
1309 #ifndef NDEBUG | 1315 #ifndef NDEBUG |
1310 // Outside the WebCore namespace for ease of invocation from gdb. | 1316 // Outside the WebCore namespace for ease of invocation from gdb. |
1311 void showLayerTree(const WebCore::RenderLayer*); | 1317 void showLayerTree(const WebCore::RenderLayer*); |
1312 void showLayerTree(const WebCore::RenderObject*); | 1318 void showLayerTree(const WebCore::RenderObject*); |
1313 #endif | 1319 #endif |
1314 | 1320 |
1315 #endif // RenderLayer_h | 1321 #endif // RenderLayer_h |
OLD | NEW |