From e4aa9d36de0a0d0c833598f35fa88730df5d4b7c Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Mon, 16 Nov 2015 11:00:32 -0800 Subject: [PATCH] Backed out changeset cbc8ceae73a2 (bug 576927) for test_value_cloning.html bustage CLOSED TREE --HG-- extra : commitid : KD1fFkxta16 --- layout/base/nsPresContext.h | 1 - layout/style/nsStyleStruct.cpp | 7 ++----- layout/style/nsStyleStruct.h | 2 -- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index 3781b7a939e9..e7168d5d9bc7 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -529,7 +529,6 @@ public: float TextZoom() { return mTextZoom; } void SetTextZoom(float aZoom) { - MOZ_ASSERT(aZoom > 0.0f, "invalid zoom factor"); if (aZoom == mTextZoom) return; diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 375745170c7d..dfbcbf756b39 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -200,16 +200,13 @@ nsChangeHint nsStyleFont::CalcDifference(const nsStyleFont& aOther) const /* static */ nscoord nsStyleFont::ZoomText(nsPresContext *aPresContext, nscoord aSize) { - MOZ_ASSERT(aSize >= 0, "negative font size"); - return NSCoordSaturatingNonnegativeMultiply(aSize, aPresContext->TextZoom()); + return nscoord(float(aSize) * aPresContext->TextZoom()); } /* static */ nscoord nsStyleFont::UnZoomText(nsPresContext *aPresContext, nscoord aSize) { - MOZ_ASSERT(aSize >= 0, "negative font size"); - return NSCoordSaturatingNonnegativeMultiply(aSize, - 1.0 / aPresContext->TextZoom()); + return nscoord(float(aSize) / aPresContext->TextZoom()); } /* static */ already_AddRefed diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 0385110d9e3f..aa33be685dba 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -119,9 +119,7 @@ struct nsStyleFont { } static nsChangeHint CalcFontDifference(const nsFont& aFont1, const nsFont& aFont2); - // aSize must be non-negative; the result is clamped to 0 .. nscoord_MAX static nscoord ZoomText(nsPresContext* aPresContext, nscoord aSize); - // aSize must be non-negative; the result is clamped to 0 .. nscoord_MAX static nscoord UnZoomText(nsPresContext* aPresContext, nscoord aSize); static already_AddRefed GetLanguage(nsPresContext* aPresContext);