From 64040f34832c4ef6a9c7de63dca4496515b9500f Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 21 Oct 2013 15:47:26 -0700 Subject: [PATCH] Bug 903340. Make nsDisplayScrollInfoLayer::ShouldFlattenAway side-effect-free. r=tn --- layout/base/nsDisplayList.cpp | 16 +++------------- layout/base/nsDisplayList.h | 5 +---- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index 6ce8705f1236..f4d3f512c623 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -3667,16 +3667,6 @@ nsDisplayScrollLayer::GetScrollLayerCount() #endif } -intptr_t -nsDisplayScrollLayer::RemoveScrollLayerCount() -{ - intptr_t result = GetScrollLayerCount(); - FrameProperties props = mScrolledFrame->Properties(); - props.Remove(nsIFrame::ScrollLayerCount()); - return result; -} - - nsDisplayScrollInfoLayer::nsDisplayScrollInfoLayer( nsDisplayListBuilder* aBuilder, nsIFrame* aScrolledFrame, @@ -3688,12 +3678,12 @@ nsDisplayScrollInfoLayer::nsDisplayScrollInfoLayer( #endif } -#ifdef NS_BUILD_REFCNT_LOGGING nsDisplayScrollInfoLayer::~nsDisplayScrollInfoLayer() { + FrameProperties props = mScrolledFrame->Properties(); + props.Remove(nsIFrame::ScrollLayerCount()); MOZ_COUNT_DTOR(nsDisplayScrollInfoLayer); } -#endif LayerState nsDisplayScrollInfoLayer::GetLayerState(nsDisplayListBuilder* aBuilder, @@ -3717,7 +3707,7 @@ nsDisplayScrollInfoLayer::ShouldFlattenAway(nsDisplayListBuilder* aBuilder) // one nsDisplayScrollLayer (with rendered content) or one // nsDisplayScrollInfoLayer (with only the metadata) should survive the // visibility computation. - return RemoveScrollLayerCount() == 1; + return GetScrollLayerCount() == 1; } nsDisplayZoom::nsDisplayZoom(nsDisplayListBuilder* aBuilder, diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index 74d43ec43efe..cc3cb2d93898 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -2728,11 +2728,10 @@ public: // number does not include nsDisplayScrollInfoLayers. If this number is not 1 // after merging, all the nsDisplayScrollLayers should flatten away. intptr_t GetScrollLayerCount(); - intptr_t RemoveScrollLayerCount(); virtual nsIFrame* GetScrolledFrame() { return mScrolledFrame; } -private: +protected: nsIFrame* mScrollFrame; nsIFrame* mScrolledFrame; }; @@ -2755,9 +2754,7 @@ public: nsIFrame* aScrolledFrame, nsIFrame* aScrollFrame); NS_DISPLAY_DECL_NAME("ScrollInfoLayer", TYPE_SCROLL_INFO_LAYER) -#ifdef NS_BUILD_REFCNT_LOGGING virtual ~nsDisplayScrollInfoLayer(); -#endif virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder, LayerManager* aManager,