Bug 903340. Make nsDisplayScrollInfoLayer::ShouldFlattenAway side-effect-free. r=tn

This commit is contained in:
Robert O'Callahan 2013-10-21 15:47:26 -07:00
Родитель ca5a49958b
Коммит 64040f3483
2 изменённых файлов: 4 добавлений и 17 удалений

Просмотреть файл

@ -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,

Просмотреть файл

@ -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,