From bbc6dff559b98b2718e535a6095802494799c50f Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Sun, 8 Aug 2010 13:49:06 -0500 Subject: [PATCH] Bug 579663. Part 1. Remove unused offset param from GetActiveScrolledRootFor. r=roc --- layout/base/FrameLayerBuilder.cpp | 9 ++------- layout/base/nsDisplayList.cpp | 6 +++--- layout/base/nsLayoutUtils.cpp | 11 ++--------- layout/base/nsLayoutUtils.h | 5 +---- 4 files changed, 8 insertions(+), 23 deletions(-) diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 4081523e4a3..e56d3107d32 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -978,12 +978,8 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList, } nsIFrame* f = item->GetUnderlyingFrame(); - nsPoint offsetToActiveScrolledRoot; nsIFrame* activeScrolledRoot = - nsLayoutUtils::GetActiveScrolledRootFor(f, mBuilder->ReferenceFrame(), - &offsetToActiveScrolledRoot); - NS_ASSERTION(offsetToActiveScrolledRoot == f->GetOffsetToCrossDoc(activeScrolledRoot), - "Wrong offset"); + nsLayoutUtils::GetActiveScrolledRootFor(f, mBuilder->ReferenceFrame()); if (item->IsFixedAndCoveringViewport(mBuilder)) { // Make its active scrolled root be the active scrolled root of // the enclosing viewport, since it shouldn't be scrolled by scrolled @@ -993,8 +989,7 @@ ContainerState::ProcessDisplayItems(const nsDisplayList& aList, nsLayoutUtils::GetClosestFrameOfType(f, nsGkAtoms::viewportFrame); NS_ASSERTION(viewportFrame, "no viewport???"); activeScrolledRoot = - nsLayoutUtils::GetActiveScrolledRootFor(viewportFrame, mBuilder->ReferenceFrame(), - &offsetToActiveScrolledRoot); + nsLayoutUtils::GetActiveScrolledRootFor(viewportFrame, mBuilder->ReferenceFrame()); } nscolor uniformColor; diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index a5b121b3158..7c1fcb3f647 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -1124,7 +1124,7 @@ PRBool nsDisplayWrapList::ChildrenCanBeInactive(nsDisplayListBuilder* aBuilder, nsIFrame* f = i->GetUnderlyingFrame(); if (f) { nsIFrame* activeScrolledRoot = - nsLayoutUtils::GetActiveScrolledRootFor(f, nsnull, nsnull); + nsLayoutUtils::GetActiveScrolledRootFor(f, nsnull); if (activeScrolledRoot != aActiveScrolledRoot) return PR_FALSE; } @@ -1248,7 +1248,7 @@ nsDisplayOpacity::GetLayerState(nsDisplayListBuilder* aBuilder, if (mFrame->AreLayersMarkedActive()) return LAYER_ACTIVE; nsIFrame* activeScrolledRoot = - nsLayoutUtils::GetActiveScrolledRootFor(mFrame, nsnull, nsnull); + nsLayoutUtils::GetActiveScrolledRootFor(mFrame, nsnull); return !ChildrenCanBeInactive(aBuilder, aManager, mList, activeScrolledRoot) ? LAYER_ACTIVE : LAYER_INACTIVE; } @@ -1618,7 +1618,7 @@ nsDisplayTransform::GetLayerState(nsDisplayListBuilder* aBuilder, if (mFrame->AreLayersMarkedActive()) return LAYER_ACTIVE; nsIFrame* activeScrolledRoot = - nsLayoutUtils::GetActiveScrolledRootFor(mFrame, nsnull, nsnull); + nsLayoutUtils::GetActiveScrolledRootFor(mFrame, nsnull); return !mStoredList.ChildrenCanBeInactive(aBuilder, aManager, *mStoredList.GetList(), diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index e7c369390e4..432032a76a4 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -680,26 +680,19 @@ nsLayoutUtils::GetScrollableFrameFor(nsIFrame *aScrolledFrame) nsIFrame* nsLayoutUtils::GetActiveScrolledRootFor(nsIFrame* aFrame, - nsIFrame* aStopAtAncestor, - nsPoint* aOffset) + nsIFrame* aStopAtAncestor) { - nsPoint offset(0,0); nsIFrame* f = aFrame; while (f != aStopAtAncestor) { NS_ASSERTION(!IsPopup(f), "Should have stopped before popup"); - nsPoint extraOffset(0,0); - nsIFrame* parent = GetCrossDocParentFrame(f, &extraOffset); + nsIFrame* parent = GetCrossDocParentFrame(f); if (!parent) break; nsIScrollableFrame* sf = do_QueryFrame(parent); if (sf && sf->IsScrollingActive() && sf->GetScrolledFrame() == f) break; - offset += f->GetPosition() + extraOffset; f = parent; } - if (aOffset) { - *aOffset = offset; - } return f; } diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index aaeb9a13701..f0044fdb862 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -296,12 +296,9 @@ public: * such ancestor before we reach aStopAtAncestor in the ancestor chain. * We expect frames with the same "active scrolled root" to be * scrolled together, so we'll place them in the same ThebesLayer. - * @param aOffset the offset from aFrame to the returned frame is stored - * here, if non-null */ static nsIFrame* GetActiveScrolledRootFor(nsIFrame* aFrame, - nsIFrame* aStopAtAncestor, - nsPoint* aOffset); + nsIFrame* aStopAtAncestor); /** * GetFrameFor returns the root frame for a view