diff --git a/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp b/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp index 01356afb5a3..e92fb609f0d 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLFrame.cpp @@ -417,7 +417,7 @@ nsMathMLFrame::CalcLength(nsPresContext* aPresContext, NS_ASSERTION(aCSSValue.IsLengthUnit(), "not a length unit"); if (aCSSValue.IsFixedLengthUnit()) { - return aCSSValue.GetLengthTwips(aPresContext); + return aCSSValue.GetLengthTwips(); } nsCSSUnit unit = aCSSValue.GetUnit(); diff --git a/mozilla/layout/style/nsCSSValue.cpp b/mozilla/layout/style/nsCSSValue.cpp index 6bc229ad674..c5cd5a5dba2 100644 --- a/mozilla/layout/style/nsCSSValue.cpp +++ b/mozilla/layout/style/nsCSSValue.cpp @@ -41,7 +41,6 @@ #include "imgIRequest.h" #include "nsIDocument.h" #include "nsContentUtils.h" -#include "nsPresContext.h" // Paint forcing #include "prenv.h" @@ -208,39 +207,36 @@ imgIRequest* nsCSSValue::GetImageValue() const return mValue.mImage->mRequest; } -nscoord nsCSSValue::GetLengthTwips(nsPresContext* aPresContext) const +nscoord nsCSSValue::GetLengthTwips() const { NS_ASSERTION(IsFixedLengthUnit(), "not a fixed length unit"); - NS_ASSERTION(aPresContext, "aPresContext is null"); - float scale = - aPresContext->ScaledPixelsToTwips() / aPresContext->PixelsToTwips(); if (IsFixedLengthUnit()) { switch (mUnit) { case eCSSUnit_Inch: - return NS_INCHES_TO_TWIPS(mValue.mFloat * scale); + return NS_INCHES_TO_TWIPS(mValue.mFloat); case eCSSUnit_Foot: - return NS_FEET_TO_TWIPS(mValue.mFloat * scale); + return NS_FEET_TO_TWIPS(mValue.mFloat); case eCSSUnit_Mile: - return NS_MILES_TO_TWIPS(mValue.mFloat * scale); + return NS_MILES_TO_TWIPS(mValue.mFloat); case eCSSUnit_Millimeter: - return NS_MILLIMETERS_TO_TWIPS(mValue.mFloat * scale); + return NS_MILLIMETERS_TO_TWIPS(mValue.mFloat); case eCSSUnit_Centimeter: - return NS_CENTIMETERS_TO_TWIPS(mValue.mFloat * scale); + return NS_CENTIMETERS_TO_TWIPS(mValue.mFloat); case eCSSUnit_Meter: - return NS_METERS_TO_TWIPS(mValue.mFloat * scale); + return NS_METERS_TO_TWIPS(mValue.mFloat); case eCSSUnit_Kilometer: - return NS_KILOMETERS_TO_TWIPS(mValue.mFloat * scale); + return NS_KILOMETERS_TO_TWIPS(mValue.mFloat); case eCSSUnit_Point: - return NSFloatPointsToTwips(mValue.mFloat * scale); + return NSFloatPointsToTwips(mValue.mFloat); case eCSSUnit_Pica: - return NS_PICAS_TO_TWIPS(mValue.mFloat * scale); + return NS_PICAS_TO_TWIPS(mValue.mFloat); case eCSSUnit_Didot: - return NS_DIDOTS_TO_TWIPS(mValue.mFloat * scale); + return NS_DIDOTS_TO_TWIPS(mValue.mFloat); case eCSSUnit_Cicero: - return NS_CICEROS_TO_TWIPS(mValue.mFloat * scale); + return NS_CICEROS_TO_TWIPS(mValue.mFloat); default: NS_ERROR("should never get here"); break; diff --git a/mozilla/layout/style/nsCSSValue.h b/mozilla/layout/style/nsCSSValue.h index 5b5c62ae790..930991d9357 100644 --- a/mozilla/layout/style/nsCSSValue.h +++ b/mozilla/layout/style/nsCSSValue.h @@ -49,7 +49,6 @@ class imgIRequest; class nsIDocument; -class nsPresContext; enum nsCSSUnit { eCSSUnit_Null = 0, // (n/a) null unit, value is not specified @@ -244,7 +243,7 @@ public: // all over. NS_HIDDEN_(imgIRequest*) GetImageValue() const; - NS_HIDDEN_(nscoord) GetLengthTwips(nsPresContext* aPresContext) const; + NS_HIDDEN_(nscoord) GetLengthTwips() const; NS_HIDDEN_(void) Reset() // sets to null { diff --git a/mozilla/layout/style/nsRuleNode.cpp b/mozilla/layout/style/nsRuleNode.cpp index 99f8a3a16fe..c77ba74a259 100644 --- a/mozilla/layout/style/nsRuleNode.cpp +++ b/mozilla/layout/style/nsRuleNode.cpp @@ -196,7 +196,7 @@ nscoord CalcLength(const nsCSSValue& aValue, { NS_ASSERTION(aValue.IsLengthUnit(), "not a length unit"); if (aValue.IsFixedLengthUnit()) { - return aValue.GetLengthTwips(aPresContext); + return aValue.GetLengthTwips(); } nsCSSUnit unit = aValue.GetUnit(); if (unit == eCSSUnit_Pixel) {