Backed out changeset cbc8ceae73a2 (bug 576927) for test_value_cloning.html bustage CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Mon, 16 Nov 2015 11:00:32 -0800
changeset 272717 5e28f202bd55
parent 272716 e1ef40eb7308
child 272718 734a55000c77
push id68058
push userkwierso@gmail.com
push dateMon, 16 Nov 2015 19:00:53 +0000
treeherdermozilla-inbound@03132276017e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs576927
milestone45.0a1
backs outcbc8ceae73a2
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset cbc8ceae73a2 (bug 576927) for test_value_cloning.html bustage CLOSED TREE
layout/base/nsPresContext.h
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -524,17 +524,16 @@ public:
   void SetPrintPreviewScale(float aScale) { mPPScale = aScale; }
 
   nsDeviceContext* DeviceContext() { return mDeviceContext; }
   mozilla::EventStateManager* EventStateManager() { return mEventManager; }
   nsIAtom* GetLanguageFromCharset() { return mLanguage; }
 
   float TextZoom() { return mTextZoom; }
   void SetTextZoom(float aZoom) {
-    MOZ_ASSERT(aZoom > 0.0f, "invalid zoom factor");
     if (aZoom == mTextZoom)
       return;
 
     mTextZoom = aZoom;
     if (HasCachedStyleData()) {
       // Media queries could have changed, since we changed the meaning
       // of 'em' units in them.
       MediaFeatureValuesChanged(eRestyle_ForceDescendants,
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -195,26 +195,23 @@ nsChangeHint nsStyleFont::CalcDifference
   }
 
   return NS_STYLE_HINT_NONE;
 }
 
 /* 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<nsIAtom>
 nsStyleFont::GetLanguage(nsPresContext* aPresContext)
 {
   nsAutoString language;
   aPresContext->Document()->GetContentLanguage(language);
   language.StripWhitespace();
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -114,19 +114,17 @@ struct nsStyleFont {
     // CalcDifference never returns the reflow hints that are sometimes
     // handled for descendants as hints not handled for descendants.
     return nsChangeHint_NeedReflow |
            nsChangeHint_ReflowChangesSizeOrPosition |
            nsChangeHint_ClearAncestorIntrinsics;
   }
   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<nsIAtom> GetLanguage(nsPresContext* aPresContext);
 
   void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
     return aContext->PresShell()->
       AllocateByObjectID(mozilla::eArenaObjectID_nsStyleFont, sz);
   }
   void Destroy(nsPresContext* aContext);