| 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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 bool hasVisibleBoxDecorations() const; | 547 bool hasVisibleBoxDecorations() const; |
| 548 // Returns true if this layer has visible content (ignoring any child layers
). | 548 // Returns true if this layer has visible content (ignoring any child layers
). |
| 549 bool isVisuallyNonEmpty() const; | 549 bool isVisuallyNonEmpty() const; |
| 550 // True if this layer container renderers that paint. | 550 // True if this layer container renderers that paint. |
| 551 bool hasNonEmptyChildRenderers() const; | 551 bool hasNonEmptyChildRenderers() const; |
| 552 | 552 |
| 553 // FIXME: We should ASSERT(!m_hasSelfPaintingLayerDescendantDirty); here but
we hit the same bugs as visible content above. | 553 // FIXME: We should ASSERT(!m_hasSelfPaintingLayerDescendantDirty); here but
we hit the same bugs as visible content above. |
| 554 // Part of the issue is with subtree relayout: we don't check if our ancesto
rs have some descendant flags dirty, missing some updates. | 554 // Part of the issue is with subtree relayout: we don't check if our ancesto
rs have some descendant flags dirty, missing some updates. |
| 555 bool hasSelfPaintingLayerDescendant() const { return m_hasSelfPaintingLayerD
escendant; } | 555 bool hasSelfPaintingLayerDescendant() const { return m_hasSelfPaintingLayerD
escendant; } |
| 556 | 556 |
| 557 // This returns true if we have an out of flow positioned descendant whose | 557 // FIXME: We should ASSERT(!m_hasOutOfFlowPositionedDescendantDirty) here. S
ee above. |
| 558 // containing block is not a descendant of ours. If this is true, we cannot | |
| 559 // automatically opt into composited scrolling since this out of flow | |
| 560 // positioned descendant would become clipped by us, possibly altering the | |
| 561 // rendering of the page. | |
| 562 // FIXME: We should ASSERT(!m_hasOutOfFlowPositionedDescendantDirty); here b
ut we may hit the same bugs as visible content above. | |
| 563 bool hasOutOfFlowPositionedDescendant() const { return m_hasOutOfFlowPositio
nedDescendant; } | 558 bool hasOutOfFlowPositionedDescendant() const { return m_hasOutOfFlowPositio
nedDescendant; } |
| 564 | 559 |
| 560 bool hasUnclippedDescendant() const { return m_hasUnclippedDescendant; } |
| 561 void updateHasUnclippedDescendant(); |
| 562 |
| 565 // Gets the nearest enclosing positioned ancestor layer (also includes | 563 // Gets the nearest enclosing positioned ancestor layer (also includes |
| 566 // the <html> layer and the root layer). | 564 // the <html> layer and the root layer). |
| 567 RenderLayer* enclosingPositionedAncestor() const; | 565 RenderLayer* enclosingPositionedAncestor() const; |
| 568 | 566 |
| 569 // Returns the nearest enclosing layer that is scrollable. | 567 // Returns the nearest enclosing layer that is scrollable. |
| 570 RenderLayer* enclosingScrollableLayer() const; | 568 RenderLayer* enclosingScrollableLayer() const; |
| 571 | 569 |
| 572 // The layer relative to which clipping rects for this layer are computed. | 570 // The layer relative to which clipping rects for this layer are computed. |
| 573 RenderLayer* clippingRootForPainting() const; | 571 RenderLayer* clippingRootForPainting() const; |
| 574 | 572 |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 | 843 |
| 846 void updateNormalFlowList(); | 844 void updateNormalFlowList(); |
| 847 | 845 |
| 848 bool isStackingContext(const RenderStyle* style) const { return !style->hasA
utoZIndex() || isRootLayer(); } | 846 bool isStackingContext(const RenderStyle* style) const { return !style->hasA
utoZIndex() || isRootLayer(); } |
| 849 | 847 |
| 850 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack
ingContainer(); } | 848 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack
ingContainer(); } |
| 851 | 849 |
| 852 void setAncestorChainHasSelfPaintingLayerDescendant(); | 850 void setAncestorChainHasSelfPaintingLayerDescendant(); |
| 853 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); | 851 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); |
| 854 | 852 |
| 853 void setAncestorChainHasOutOfFlowPositionedDescendant(); |
| 854 void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); |
| 855 |
| 855 bool acceleratedCompositingForOverflowScrollEnabled() const; | 856 bool acceleratedCompositingForOverflowScrollEnabled() const; |
| 856 void updateDescendantsAreContiguousInStackingOrder(); | 857 void updateDescendantsAreContiguousInStackingOrder(); |
| 857 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<co
nst RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIte
ration); | 858 void updateDescendantsAreContiguousInStackingOrderRecursive(const HashMap<co
nst RenderLayer*, int>&, int& minIndex, int& maxIndex, int& count, bool firstIte
ration); |
| 858 void collectBeforePromotionZOrderList(RenderLayer* ancestorStackingContext,
OwnPtr<Vector<RenderLayer*> >& posZOrderListBeforePromote, OwnPtr<Vector<RenderL
ayer*> >& negZOrderListBeforePromote); | 859 void collectBeforePromotionZOrderList(RenderLayer* ancestorStackingContext,
OwnPtr<Vector<RenderLayer*> >& posZOrderListBeforePromote, OwnPtr<Vector<RenderL
ayer*> >& negZOrderListBeforePromote); |
| 859 void collectAfterPromotionZOrderList(RenderLayer* ancestorStackingContext, O
wnPtr<Vector<RenderLayer*> >& posZOrderListAfterPromote, OwnPtr<Vector<RenderLay
er*> >& negZOrderListAfterPromote); | 860 void collectAfterPromotionZOrderList(RenderLayer* ancestorStackingContext, O
wnPtr<Vector<RenderLayer*> >& posZOrderListAfterPromote, OwnPtr<Vector<RenderLay
er*> >& negZOrderListAfterPromote); |
| 860 | 861 |
| 861 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, con
st RenderGeometryMap* = 0); | 862 void computeRepaintRects(const RenderLayerModelObject* repaintContainer, con
st RenderGeometryMap* = 0); |
| 862 void computeRepaintRectsIncludingDescendants(); | 863 void computeRepaintRectsIncludingDescendants(); |
| 863 void clearRepaintRects(); | 864 void clearRepaintRects(); |
| 864 | 865 |
| 865 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect&
paintDirtyRect, const ClipRect&, | 866 void clipToRect(RenderLayer* rootLayer, GraphicsContext*, const LayoutRect&
paintDirtyRect, const ClipRect&, |
| 866 BorderRadiusClippingRule = IncludeSelfForBorderRadius); | 867 BorderRadiusClippingRule = IncludeSelfForBorderRadius); |
| 867 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C
lipRect&); | 868 void restoreClip(GraphicsContext*, const LayoutRect& paintDirtyRect, const C
lipRect&); |
| 868 | 869 |
| 869 bool shouldRepaintAfterLayout() const; | 870 bool shouldRepaintAfterLayout() const; |
| 870 | 871 |
| 871 void updateSelfPaintingLayer(); | 872 void updateSelfPaintingLayer(); |
| 872 void updateIsNormalFlowOnly(); | 873 void updateIsNormalFlowOnly(); |
| 873 void updateVisibilityAfterStyleChange(const RenderStyle* oldStyle); | 874 void updateVisibilityAfterStyleChange(const RenderStyle* oldStyle); |
| 874 void updateStackingContextsAfterStyleChange(const RenderStyle* oldStyle); | 875 void updateStackingContextsAfterStyleChange(const RenderStyle* oldStyle); |
| 875 | 876 |
| 876 void updateScrollbarsAfterStyleChange(const RenderStyle* oldStyle); | 877 void updateScrollbarsAfterStyleChange(const RenderStyle* oldStyle); |
| 877 void updateScrollbarsAfterLayout(); | 878 void updateScrollbarsAfterLayout(); |
| 878 | 879 |
| 879 void setAncestorChainHasOutOfFlowPositionedDescendant(RenderObject* containi
ngBlock); | |
| 880 void dirtyAncestorChainHasOutOfFlowPositionedDescendantStatus(); | |
| 881 void updateOutOfFlowPositioned(const RenderStyle* oldStyle); | 880 void updateOutOfFlowPositioned(const RenderStyle* oldStyle); |
| 882 | 881 |
| 883 void updateNeedsCompositedScrolling(); | 882 virtual void updateNeedsCompositedScrolling() OVERRIDE; |
| 883 void setNeedsCompositedScrolling(bool); |
| 884 void didUpdateNeedsCompositedScrolling(); | 884 void didUpdateNeedsCompositedScrolling(); |
| 885 | 885 |
| 886 // Returns true if the position changed. | 886 // Returns true if the position changed. |
| 887 bool updateLayerPosition(); | 887 bool updateLayerPosition(); |
| 888 | 888 |
| 889 void updateLayerPositions(RenderGeometryMap* = 0, UpdateLayerPositionsFlags
= defaultFlags); | 889 void updateLayerPositions(RenderGeometryMap* = 0, UpdateLayerPositionsFlags
= defaultFlags); |
| 890 | 890 |
| 891 enum UpdateLayerPositionsAfterScrollFlag { | 891 enum UpdateLayerPositionsAfterScrollFlag { |
| 892 NoFlag = 0, | 892 NoFlag = 0, |
| 893 IsOverflowScroll = 1 << 0, | 893 IsOverflowScroll = 1 << 0, |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1040 void updateCompositingLayersAfterScroll(); | 1040 void updateCompositingLayersAfterScroll(); |
| 1041 | 1041 |
| 1042 IntSize scrollbarOffset(const Scrollbar*) const; | 1042 IntSize scrollbarOffset(const Scrollbar*) const; |
| 1043 | 1043 |
| 1044 void updateResizerAreaSet(); | 1044 void updateResizerAreaSet(); |
| 1045 void updateScrollableAreaSet(bool hasOverflow); | 1045 void updateScrollableAreaSet(bool hasOverflow); |
| 1046 | 1046 |
| 1047 void dirtyAncestorChainVisibleDescendantStatus(); | 1047 void dirtyAncestorChainVisibleDescendantStatus(); |
| 1048 void setAncestorChainHasVisibleDescendant(); | 1048 void setAncestorChainHasVisibleDescendant(); |
| 1049 | 1049 |
| 1050 void updateDescendantDependentFlags(HashSet<const RenderObject*>* outOfFlowD
escendantContainingBlocks = 0); | 1050 void updateDescendantDependentFlags(); |
| 1051 | 1051 |
| 1052 // This flag is computed by RenderLayerCompositor, which knows more about 3d
hierarchies than we do. | 1052 // This flag is computed by RenderLayerCompositor, which knows more about 3d
hierarchies than we do. |
| 1053 void setHas3DTransformedDescendant(bool b) { m_has3DTransformedDescendant =
b; } | 1053 void setHas3DTransformedDescendant(bool b) { m_has3DTransformedDescendant =
b; } |
| 1054 bool has3DTransformedDescendant() const { return m_has3DTransformedDescendan
t; } | 1054 bool has3DTransformedDescendant() const { return m_has3DTransformedDescendan
t; } |
| 1055 | 1055 |
| 1056 void dirty3DTransformedDescendantStatus(); | 1056 void dirty3DTransformedDescendantStatus(); |
| 1057 // Both updates the status, and returns true if descendants of this have 3d. | 1057 // Both updates the status, and returns true if descendants of this have 3d. |
| 1058 bool update3DTransformedDescendantStatus(); | 1058 bool update3DTransformedDescendantStatus(); |
| 1059 | 1059 |
| 1060 void createReflection(); | 1060 void createReflection(); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 bool m_normalFlowListDirty: 1; | 1139 bool m_normalFlowListDirty: 1; |
| 1140 bool m_isNormalFlowOnly : 1; | 1140 bool m_isNormalFlowOnly : 1; |
| 1141 | 1141 |
| 1142 bool m_isSelfPaintingLayer : 1; | 1142 bool m_isSelfPaintingLayer : 1; |
| 1143 | 1143 |
| 1144 // If have no self-painting descendants, we don't have to walk our children
during painting. This can lead to | 1144 // If have no self-painting descendants, we don't have to walk our children
during painting. This can lead to |
| 1145 // significant savings, especially if the tree has lots of non-self-painting
layers grouped together (e.g. table cells). | 1145 // significant savings, especially if the tree has lots of non-self-painting
layers grouped together (e.g. table cells). |
| 1146 bool m_hasSelfPaintingLayerDescendant : 1; | 1146 bool m_hasSelfPaintingLayerDescendant : 1; |
| 1147 bool m_hasSelfPaintingLayerDescendantDirty : 1; | 1147 bool m_hasSelfPaintingLayerDescendantDirty : 1; |
| 1148 | 1148 |
| 1149 // If we have no out of flow positioned descendants and no non-descendant | |
| 1150 // appears between our descendants in stacking order, then we may become a | |
| 1151 // stacking context. | |
| 1152 bool m_hasOutOfFlowPositionedDescendant : 1; | 1149 bool m_hasOutOfFlowPositionedDescendant : 1; |
| 1153 bool m_hasOutOfFlowPositionedDescendantDirty : 1; | 1150 bool m_hasOutOfFlowPositionedDescendantDirty : 1; |
| 1154 | 1151 |
| 1152 // This is true if we have an out-of-flow positioned descendant whose |
| 1153 // containing block is our ancestor. If this is the case, the descendant |
| 1154 // may fall outside of our clip preventing things like opting into |
| 1155 // composited scrolling (which causes clipping of all descendants). |
| 1156 bool m_hasUnclippedDescendant : 1; |
| 1157 |
| 1155 bool m_needsCompositedScrolling : 1; | 1158 bool m_needsCompositedScrolling : 1; |
| 1156 | 1159 |
| 1157 // If this is true, then no non-descendant appears between any of our | 1160 // If this is true, then no non-descendant appears between any of our |
| 1158 // descendants in stacking order. This is one of the requirements of being | 1161 // descendants in stacking order. This is one of the requirements of being |
| 1159 // able to safely become a stacking context. | 1162 // able to safely become a stacking context. |
| 1160 bool m_descendantsAreContiguousInStackingOrder : 1; | 1163 bool m_descendantsAreContiguousInStackingOrder : 1; |
| 1161 bool m_descendantsAreContiguousInStackingOrderDirty : 1; | 1164 bool m_descendantsAreContiguousInStackingOrderDirty : 1; |
| 1162 | 1165 |
| 1163 const bool m_isRootLayer : 1; | 1166 const bool m_isRootLayer : 1; |
| 1164 | 1167 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1335 | 1338 |
| 1336 } // namespace WebCore | 1339 } // namespace WebCore |
| 1337 | 1340 |
| 1338 #ifndef NDEBUG | 1341 #ifndef NDEBUG |
| 1339 // Outside the WebCore namespace for ease of invocation from gdb. | 1342 // Outside the WebCore namespace for ease of invocation from gdb. |
| 1340 void showLayerTree(const WebCore::RenderLayer*); | 1343 void showLayerTree(const WebCore::RenderLayer*); |
| 1341 void showLayerTree(const WebCore::RenderObject*); | 1344 void showLayerTree(const WebCore::RenderObject*); |
| 1342 #endif | 1345 #endif |
| 1343 | 1346 |
| 1344 #endif // RenderLayer_h | 1347 #endif // RenderLayer_h |
| OLD | NEW |