Bug 1278214 - ensure operation result is floating point. r?mats
MozReview-Commit-ID: AwIH4G2GlPv
--- 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);
}