Bug 1278214 - ensure operation result is floating point. r=mats
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Mon, 06 Jun 2016 17:14:37 +0300
changeset 300641 ffe52673664fa60184c9221003b67ffad3465ca7
parent 300640 44979a0469563c8d239669a790ea15ee4d58ff23
child 300642 581cba07c3793b9788f8e041481e99874f05fa01
push id78021
push userBogdan.Postelnicu@softvision.ro
push dateMon, 06 Jun 2016 14:21:14 +0000
treeherdermozilla-inbound@ffe52673664f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1278214
milestone49.0a1
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
Bug 1278214 - ensure operation result is floating point. r=mats MozReview-Commit-ID: AwIH4G2GlPv
layout/base/nsCSSRendering.cpp
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -3329,17 +3329,17 @@ ComputeDrawnSizeForBackground(const CSSS
  * aAvailableSpace: the background positioning area width/height
  * aRepeatSize: the image size plus gap size of app units for use as spacing
  * aRepeat: determine whether the image is repeated
  */
 static nscoord
 ComputeSpacedRepeatSize(nscoord aImageDimension,
                         nscoord aAvailableSpace,
                         bool& aRepeat) {
-  float ratio = aAvailableSpace / aImageDimension;
+  float ratio = static_cast<float>(aAvailableSpace) / aImageDimension;
 
   if (ratio < 2.0f) { // If you can't repeat at least twice, then don't repeat.
     aRepeat = false;
     return aImageDimension;
   } else {
     aRepeat = true;
     return (aAvailableSpace - aImageDimension) / (NSToIntFloor(ratio) - 1);
   }