Bug 735857 - Factor out a helper function nsLayoutUtils::IsTransformed(). r=mstange
MozReview-Commit-ID: 4AJUVDLAYrc
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -3073,27 +3073,16 @@ nsCSSRendering::PaintBackgroundWithSC(ns
}
}
}
}
return result;
}
-static inline bool
-IsTransformed(nsIFrame* aForFrame, nsIFrame* aTopFrame)
-{
- for (nsIFrame* f = aForFrame; f != aTopFrame; f = f->GetParent()) {
- if (f->IsTransformed()) {
- return true;
- }
- }
- return false;
-}
-
nsRect
nsCSSRendering::ComputeImageLayerPositioningArea(nsPresContext* aPresContext,
nsIFrame* aForFrame,
const nsRect& aBorderArea,
const nsStyleImageLayers::Layer& aLayer,
nsIFrame** aAttachedToFrame)
{
// Compute background origin area relative to aBorderArea now as we may need
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -9132,8 +9132,20 @@ nsLayoutUtils::UpdateDisplayPortMarginsF
}
UpdateDisplayPortMarginsForPendingMetrics(frame);
}
return true;
});
}
}
+
+/* static */ bool
+nsLayoutUtils::IsTransformed(nsIFrame* aForFrame, nsIFrame* aTopFrame)
+{
+ for (nsIFrame* f = aForFrame; f != aTopFrame; f = f->GetParent()) {
+ if (f->IsTransformed()) {
+ return true;
+ }
+ }
+ return false;
+}
+
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -2801,16 +2801,23 @@ public:
static CSSRect GetBoundingContentRect(const nsIContent* aContent,
const nsIScrollableFrame* aRootScrollFrame);
/**
* Returns the first ancestor who is a float containing block.
*/
static nsBlockFrame* GetFloatContainingBlock(nsIFrame* aFrame);
+ /**
+ * Walks up the frame tree from |aForFrame| up to |aTopFrame|, or to the
+ * root of the frame tree if |aTopFrame| is nullptr, and returns true if
+ * a transformed frame is encountered.
+ */
+ static bool IsTransformed(nsIFrame* aForFrame, nsIFrame* aTopFrame = nullptr);
+
private:
static uint32_t sFontSizeInflationEmPerLine;
static uint32_t sFontSizeInflationMinTwips;
static uint32_t sFontSizeInflationLineThreshold;
static int32_t sFontSizeInflationMappingIntercept;
static uint32_t sFontSizeInflationMaxRatio;
static bool sFontSizeInflationForceEnabled;
static bool sFontSizeInflationDisabledInMasterProcess;