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

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: Addressing 2nd review 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
« 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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 858
859 void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotComposi tedReason reason) { m_compositingProperties.viewportConstrainedNotCompositedReas on = reason; } 859 void setViewportConstrainedNotCompositedReason(ViewportConstrainedNotComposi tedReason reason) { m_compositingProperties.viewportConstrainedNotCompositedReas on = reason; }
860 ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReaso n() const { return static_cast<ViewportConstrainedNotCompositedReason>(m_composi tingProperties.viewportConstrainedNotCompositedReason); } 860 ViewportConstrainedNotCompositedReason viewportConstrainedNotCompositedReaso n() const { return static_cast<ViewportConstrainedNotCompositedReason>(m_composi tingProperties.viewportConstrainedNotCompositedReason); }
861 861
862 bool isOutOfFlowRenderFlowThread() const { return renderer()->isOutOfFlowRen derFlowThread(); } 862 bool isOutOfFlowRenderFlowThread() const { return renderer()->isOutOfFlowRen derFlowThread(); }
863 863
864 enum PaintOrderListType {BeforePromote, AfterPromote}; 864 enum PaintOrderListType {BeforePromote, AfterPromote};
865 void computePaintOrderList(PaintOrderListType type, Vector<RefPtr<Node> >&); 865 void computePaintOrderList(PaintOrderListType type, Vector<RefPtr<Node> >&);
866 866
867 private: 867 private:
868 enum CollectLayersBehavior { StopAtStackingContexts, StopAtStackingContainer s }; 868 enum CollectLayersBehavior {
869 ForceLayerToStackingContainer,
870 OverflowScrollCanBeStackingContainers,
871 OnlyStackingContextsCanBeStackingContainers
872 };
869 873
870 void updateZOrderLists(); 874 void updateZOrderLists();
871 void rebuildZOrderLists(); 875 void rebuildZOrderLists();
872 // See the comment for collectLayers for information about the layerToForceA sStackingContainer parameter. 876 // See the comment for collectLayers for information about the layerToForceA sStackingContainer parameter.
873 void rebuildZOrderLists(CollectLayersBehavior, OwnPtr<Vector<RenderLayer*> > &, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layerToForceAsStackingCont ainer = 0); 877 void rebuildZOrderLists(OwnPtr<Vector<RenderLayer*> >&, OwnPtr<Vector<Render Layer*> >&, const RenderLayer* layerToForceAsStackingContainer = 0, CollectLayer sBehavior = OverflowScrollCanBeStackingContainers);
874 void clearZOrderLists(); 878 void clearZOrderLists();
875 879
876 void updateNormalFlowList(); 880 void updateNormalFlowList();
877 881
878 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); } 882 bool isStackingContext(const RenderStyle* style) const { return !style->hasA utoZIndex() || isRootLayer(); }
879 883
880 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); } 884 bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStack ingContainer(); }
881 885
882 void setAncestorChainHasSelfPaintingLayerDescendant(); 886 void setAncestorChainHasSelfPaintingLayerDescendant();
883 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus(); 887 void dirtyAncestorChainHasSelfPaintingLayerDescendantStatus();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 void setParent(RenderLayer* parent); 946 void setParent(RenderLayer* parent);
943 void setFirstChild(RenderLayer* first) { m_first = first; } 947 void setFirstChild(RenderLayer* first) { m_first = first; }
944 void setLastChild(RenderLayer* last) { m_last = last; } 948 void setLastChild(RenderLayer* last) { m_last = last; }
945 949
946 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); } 950 LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRende rBox(renderer())->location() : LayoutPoint(); }
947 951
948 // layerToForceAsStackingContainer allows us to build pre-promotion and 952 // layerToForceAsStackingContainer allows us to build pre-promotion and
949 // post-promotion layer lists, by allowing us to treat a layer as if it is a 953 // post-promotion layer lists, by allowing us to treat a layer as if it is a
950 // stacking context, without adding a new member to RenderLayer or modifying 954 // stacking context, without adding a new member to RenderLayer or modifying
951 // the style (which could cause extra allocations). 955 // the style (which could cause extra allocations).
952 void collectLayers(bool includeHiddenLayers, CollectLayersBehavior, OwnPtr<V ector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layer ToForceAsStackingContainer = 0); 956 void collectLayers(bool includeHiddenLayers, OwnPtr<Vector<RenderLayer*> >&, OwnPtr<Vector<RenderLayer*> >&, const RenderLayer* layerToForceAsStackingContai ner = 0, CollectLayersBehavior = OverflowScrollCanBeStackingContainers);
953 957
954 struct LayerPaintingInfo { 958 struct LayerPaintingInfo {
955 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRec t, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, Rend erObject* inPaintingRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0) 959 LayerPaintingInfo(RenderLayer* inRootLayer, const LayoutRect& inDirtyRec t, PaintBehavior inPaintBehavior, const LayoutSize& inSubPixelAccumulation, Rend erObject* inPaintingRoot = 0, RenderRegion*inRegion = 0, OverlapTestRequestMap* inOverlapTestRequests = 0)
956 : rootLayer(inRootLayer) 960 : rootLayer(inRootLayer)
957 , paintingRoot(inPaintingRoot) 961 , paintingRoot(inPaintingRoot)
958 , paintDirtyRect(inDirtyRect) 962 , paintDirtyRect(inDirtyRect)
959 , subPixelAccumulation(inSubPixelAccumulation) 963 , subPixelAccumulation(inSubPixelAccumulation)
960 , region(inRegion) 964 , region(inRegion)
961 , overlapTestRequests(inOverlapTestRequests) 965 , overlapTestRequests(inOverlapTestRequests)
962 , paintBehavior(inPaintBehavior) 966 , paintBehavior(inPaintBehavior)
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT ransformState* = 0, double* zOffset = 0); 1029 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT ransformState* = 0, double* zOffset = 0);
1026 1030
1027 bool listBackgroundIsKnownToBeOpaqueInRect(const Vector<RenderLayer*>*, cons t LayoutRect&) const; 1031 bool listBackgroundIsKnownToBeOpaqueInRect(const Vector<RenderLayer*>*, cons t LayoutRect&) const;
1028 1032
1029 void computeScrollDimensions(); 1033 void computeScrollDimensions();
1030 bool hasHorizontalOverflow() const; 1034 bool hasHorizontalOverflow() const;
1031 bool hasVerticalOverflow() const; 1035 bool hasVerticalOverflow() const;
1032 bool hasScrollableHorizontalOverflow() const; 1036 bool hasScrollableHorizontalOverflow() const;
1033 bool hasScrollableVerticalOverflow() const; 1037 bool hasScrollableVerticalOverflow() const;
1034 1038
1035 bool shouldBeNormalFlowOnly() const; 1039 bool shouldBeNormalFlowOnly(bool canNeedCompositedScrolling = true) const;
Julien - ping for review 2013/05/30 22:23:07 Really not a huge fan of adding a default *boolean
hartmanng 2013/05/31 13:55:41 Done.
1036 1040
1037 bool shouldBeSelfPaintingLayer() const; 1041 bool shouldBeSelfPaintingLayer() const;
1038 1042
1039 int scrollPosition(Scrollbar*) const; 1043 int scrollPosition(Scrollbar*) const;
1040 1044
1041 // ScrollableArea interface 1045 // ScrollableArea interface
1042 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&); 1046 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&);
1043 virtual void invalidateScrollCornerRect(const IntRect&); 1047 virtual void invalidateScrollCornerRect(const IntRect&);
1044 virtual bool isActive() const; 1048 virtual bool isActive() const;
1045 virtual bool isScrollCornerVisible() const; 1049 virtual bool isScrollCornerVisible() const;
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 1356
1353 } // namespace WebCore 1357 } // namespace WebCore
1354 1358
1355 #ifndef NDEBUG 1359 #ifndef NDEBUG
1356 // Outside the WebCore namespace for ease of invocation from gdb. 1360 // Outside the WebCore namespace for ease of invocation from gdb.
1357 void showLayerTree(const WebCore::RenderLayer*); 1361 void showLayerTree(const WebCore::RenderLayer*);
1358 void showLayerTree(const WebCore::RenderObject*); 1362 void showLayerTree(const WebCore::RenderObject*);
1359 #endif 1363 #endif
1360 1364
1361 #endif // RenderLayer_h 1365 #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