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

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

Issue 14999005: Fix RenderLayer::collectLayers logic bug. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nits + rebase for landing Created 7 years, 6 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 | « LayoutTests/TestExpectations ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | 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) 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 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 871
872 enum ForceNeedsCompositedScrollingMode { 872 enum ForceNeedsCompositedScrollingMode {
873 DoNotForceCompositedScrolling = 0, 873 DoNotForceCompositedScrolling = 0,
874 CompositedScrollingAlwaysOn = 1, 874 CompositedScrollingAlwaysOn = 1,
875 CompositedScrollingAlwaysOff = 2 875 CompositedScrollingAlwaysOff = 2
876 }; 876 };
877 877
878 void setForceNeedsCompositedScrolling(ForceNeedsCompositedScrollingMode); 878 void setForceNeedsCompositedScrolling(ForceNeedsCompositedScrollingMode);
879 879
880 private: 880 private:
881 enum CollectLayersBehavior { StopAtStackingContexts, StopAtStackingContainer s }; 881 enum CollectLayersBehavior {
882 ForceLayerToStackingContainer,
883 OverflowScrollCanBeStackingContainers,
884 OnlyStackingContextsCanBeStackingContainers
885 };
882 886
883 void updateZOrderLists(); 887 void updateZOrderLists();
884 void rebuildZOrderLists(); 888 void rebuildZOrderLists();
885 // See the comment for collectLayers for information about the layerToForceA sStackingContainer parameter. 889 // See the comment for collectLayers for information about the layerToForceA sStackingContainer parameter.
886 void rebuildZOrderLists(CollectLayersBehavior, OwnPtr<Vector<RenderLayer*> > &, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layerToForceAsStackingCont ainer = 0); 890 void rebuildZOrderLists(OwnPtr<Vector<RenderLayer*> >&, OwnPtr<Vector<Render Layer*> >&, const RenderLayer* layerToForceAsStackingContainer = 0, CollectLayer sBehavior = OverflowScrollCanBeStackingContainers);
887 void clearZOrderLists(); 891 void clearZOrderLists();
888 892
889 void updateNormalFlowList(); 893 void updateNormalFlowList();
890 894
891 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); } 895 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); }
892 896
893 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); } 897 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); }
894 898
895 void setAncestorChainHasSelfPaintingLayerDescendant(); 899 void setAncestorChainHasSelfPaintingLayerDescendant();
896 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 900 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 void setParent(RenderLayer* parent); 959 void setParent(RenderLayer* parent);
956 void setFirstChild(RenderLayer* first) { m_first = first; } 960 void setFirstChild(RenderLayer* first) { m_first = first; }
957 void setLastChild(RenderLayer* last) { m_last = last; } 961 void setLastChild(RenderLayer* last) { m_last = last; }
958 962
959 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); } 963 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); }
960 964
961 // layerToForceAsStackingContainer allows us to build pre-promotion and 965 // layerToForceAsStackingContainer allows us to build pre-promotion and
962 // post-promotion layer lists, by allowing us to treat a layer as if it is a 966 // post-promotion layer lists, by allowing us to treat a layer as if it is a
963 // stacking context, without adding a new member to RenderLayer or modifying 967 // stacking context, without adding a new member to RenderLayer or modifying
964 // the style (which could cause extra allocations). 968 // the style (which could cause extra allocations).
965 void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, OwnPtr<V ector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layer ToForceAsStackingContainer = 0); 969 void collectLayers(bool includeHiddenLayers, OwnPtr<Vector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layerToForceAsStackingContai ner = 0, CollectLayersBehavior = OverflowScrollCanBeStackingContainers);
966 970
967 struct LayerPaintingInfo { 971 struct LayerPaintingInfo {
968 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRec t, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, Rend erObject* inPaintingRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0) 972 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRec t, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, Rend erObject* inPaintingRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0)
969 : rootLayer(inRootLayer) 973 : rootLayer(inRootLayer)
970 , paintingRoot(inPaintingRoot) 974 , paintingRoot(inPaintingRoot)
971 , paintDirtyRect(inDirtyRect) 975 , paintDirtyRect(inDirtyRect)
972 , subPixelAccumulation(inSubPixelAccumulation) 976 , subPixelAccumulation(inSubPixelAccumulation)
973 , region(inRegion) 977 , region(inRegion)
974 , overlapTestRequests(inOverlapTestRequests) 978 , overlapTestRequests(inOverlapTestRequests)
975 , paintBehavior(inPaintBehavior) 979 , paintBehavior(inPaintBehavior)
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1039 1043
1040 bool listBackgroundIsKnownToBeOpaqueInRect(const Vector<RenderLayer*>*, cons t LayoutRect&) const; 1044 bool listBackgroundIsKnownToBeOpaqueInRect(const Vector<RenderLayer*>*, cons t LayoutRect&) const;
1041 1045
1042 void computeScrollDimensions(); 1046 void computeScrollDimensions();
1043 bool hasHorizontalOverflow() const; 1047 bool hasHorizontalOverflow() const;
1044 bool hasVerticalOverflow() const; 1048 bool hasVerticalOverflow() const;
1045 bool hasScrollableHorizontalOverflow() const; 1049 bool hasScrollableHorizontalOverflow() const;
1046 bool hasScrollableVerticalOverflow() const; 1050 bool hasScrollableVerticalOverflow() const;
1047 1051
1048 bool shouldBeNormalFlowOnly() const; 1052 bool shouldBeNormalFlowOnly() const;
1053 bool shouldBeNormalFlowOnlyIgnoringCompositedScrolling() const;
1049 1054
1050 bool shouldBeSelfPaintingLayer() const; 1055 bool shouldBeSelfPaintingLayer() const;
1051 1056
1052 int scrollPosition(Scrollbar*) const; 1057 int scrollPosition(Scrollbar*) const;
1053 1058
1054 // ScrollableArea interface 1059 // ScrollableArea interface
1055 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&); 1060 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&);
1056 virtual void invalidateScrollCornerRect(const IntRect&); 1061 virtual void invalidateScrollCornerRect(const IntRect&);
1057 virtual bool isActive() const; 1062 virtual bool isActive() const;
1058 virtual bool isScrollCornerVisible() const; 1063 virtual bool isScrollCornerVisible() const;
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 1372
1368 } // namespace WebCore 1373 } // namespace WebCore
1369 1374
1370 #ifndef NDEBUG 1375 #ifndef NDEBUG
1371 // Outside the WebCore namespace for ease of invocation from gdb. 1376 // Outside the WebCore namespace for ease of invocation from gdb.
1372 void showLayerTree(const WebCore::RenderLayer*); 1377 void showLayerTree(const WebCore::RenderLayer*);
1373 void showLayerTree(const WebCore::RenderObject*); 1378 void showLayerTree(const WebCore::RenderObject*);
1374 #endif 1379 #endif
1375 1380
1376 #endif // RenderLayer_h 1381 #endif // RenderLayer_h
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698