From 4def4469f5153e8ac7c91b7399cb54bb20d660ee Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Mon, 23 Jun 2014 16:21:42 +1200 Subject: [PATCH] Bug 1022612. Part 29: Expose GetAnimatedGeometryRootForFrame. r=mattwoodrow --HG-- extra : rebase_source : bca7885147f0328d9700770052500e856d131bd9 --- layout/base/nsLayoutUtils.cpp | 8 ++++---- layout/base/nsLayoutUtils.h | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 98b0aa1f3ca..67a2f195067 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -1481,7 +1481,7 @@ nsLayoutUtils::GetScrollableFrameFor(const nsIFrame *aScrolledFrame) { nsIFrame *frame = aScrolledFrame->GetParent(); nsIScrollableFrame *sf = do_QueryFrame(frame); - return sf && sf->GetScrolledFrame() == aScrolledFrame ? sf : nullptr; + return (sf && sf->GetScrolledFrame() == aScrolledFrame) ? sf : nullptr; } /* static */ void @@ -1603,9 +1603,9 @@ IsScrollbarThumbLayerized(nsIFrame* aThumbFrame) return reinterpret_cast(aThumbFrame->Properties().Get(ScrollbarThumbLayerized())); } -static nsIFrame* -GetAnimatedGeometryRootForFrame(nsIFrame* aFrame, - const nsIFrame* aStopAtAncestor) +nsIFrame* +nsLayoutUtils::GetAnimatedGeometryRootForFrame(nsIFrame* aFrame, + const nsIFrame* aStopAtAncestor) { nsIFrame* f = aFrame; nsIFrame* stickyFrame = nullptr; diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index 5dce45e63aa..6e65aba22cb 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -499,6 +499,14 @@ public: static nsIFrame* GetAnimatedGeometryRootFor(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder); + /** + * Finds the nearest ancestor frame to aFrame that is considered to have (or + * will have) "animated geometry". This could be aFrame. Returns + * aStopAtAncestor if no closer ancestor is found. + */ + static nsIFrame* GetAnimatedGeometryRootForFrame(nsIFrame* aFrame, + const nsIFrame* aStopAtAncestor); + /** * GetScrollableFrameFor returns the scrollable frame for a scrolled frame */