diff --git a/layout/style/nsStyleCoord.h b/layout/style/nsStyleCoord.h index 0c8dab67a28..725dc573d59 100644 --- a/layout/style/nsStyleCoord.h +++ b/layout/style/nsStyleCoord.h @@ -143,6 +143,11 @@ public: (IsCalcUnit() && CalcHasPercent()); } + PRBool ConvertsToLength() const { + return mUnit == eStyleUnit_Coord || + (IsCalcUnit() && !CalcHasPercent()); + } + nscoord GetCoordValue() const; PRInt32 GetIntValue() const; float GetPercentValue() const; diff --git a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp index 5b583efc6b4..498b5e43c93 100644 --- a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp @@ -480,10 +480,8 @@ DependsOnIntrinsicSize(const nsIFrame* aEmbeddingFrame) // XXX it would be nice to know if the size of aEmbeddingFrame's containing // block depends on aEmbeddingFrame, then we'd know if we can return false // for eStyleUnit_Percent too. - return (width.GetUnit() != eStyleUnit_Coord && - (!width.IsCalcUnit() || width.CalcHasPercent())) || - (height.GetUnit() != eStyleUnit_Coord && - (!height.IsCalcUnit() || height.CalcHasPercent())); + return !width.ConvertsToLength() || + !height.ConvertsToLength(); } NS_IMETHODIMP