Bug 828173 patch 3.5: Move GetTransformRootFrame to nsLayoutUtils. r=mattwoodrow

This commit is contained in:
L. David Baron 2014-03-04 20:13:21 -08:00
parent e80d256f0e
commit 1c6ed806fe
3 changed files with 28 additions and 10 deletions

View File

@ -61,6 +61,12 @@ using namespace mozilla::layers;
using namespace mozilla::dom;
typedef FrameMetrics::ViewID ViewID;
static inline nsIFrame*
GetTransformRootFrame(nsIFrame* aFrame)
{
return nsLayoutUtils::GetTransformRootFrame(aFrame);
}
static void AddTransformFunctions(nsCSSValueList* aList,
nsStyleContext* aContext,
nsPresContext* aPresContext,
@ -2878,15 +2884,6 @@ nsDisplayBoxShadowInner::ComputeVisibility(nsDisplayListBuilder* aBuilder,
return true;
}
nsIFrame *GetTransformRootFrame(nsIFrame* aFrame)
{
nsIFrame *parent = nsLayoutUtils::GetCrossDocParentFrame(aFrame);
while (parent && parent->Preserves3DChildren()) {
parent = nsLayoutUtils::GetCrossDocParentFrame(parent);
}
return parent;
}
nsDisplayWrapList::nsDisplayWrapList(nsDisplayListBuilder* aBuilder,
nsIFrame* aFrame, nsDisplayList* aList)
: nsDisplayItem(aBuilder, aFrame) {

View File

@ -4803,6 +4803,16 @@ nsLayoutUtils::GetReferenceFrame(nsIFrame* aFrame)
}
}
/* static */ nsIFrame*
nsLayoutUtils::GetTransformRootFrame(nsIFrame* aFrame)
{
nsIFrame *parent = nsLayoutUtils::GetCrossDocParentFrame(aFrame);
while (parent && parent->Preserves3DChildren()) {
parent = nsLayoutUtils::GetCrossDocParentFrame(parent);
}
return parent;
}
/* static */ uint32_t
nsLayoutUtils::GetTextRunFlagsForStyle(nsStyleContext* aStyleContext,
const nsStyleFont* aStyleFont,

View File

@ -1520,7 +1520,8 @@ public:
* Get the reference frame that would be used when constructing a
* display item for this frame. (Note, however, that
* nsDisplayTransform use the reference frame appropriate for their
* parent, rather than using their own frame as a reference frame.)
* GetTransformRootFrame(), rather than using their own frame as a
* reference frame.)
*
* This duplicates some of the logic of GetDisplayRootFrame above and
* of nsDisplayListBuilder::FindReferenceFrameFor.
@ -1530,6 +1531,16 @@ public:
*/
static nsIFrame* GetReferenceFrame(nsIFrame* aFrame);
/**
* Get the parent of this frame, except if that parent is part of a
* preserve-3d hierarchy, get the parent of the root of the
* preserve-3d hierarchy.
*
* (This is used as the starting point for reference frame computation
* for nsDisplayTransform display items.)
*/
static nsIFrame* GetTransformRootFrame(nsIFrame* aFrame);
/**
* Get textrun construction flags determined by a given style; in particular
* some combination of: