summaryrefslogtreecommitdiffstats
path: root/layout/svg/nsSVGOuterSVGFrame.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-09-14 20:54:19 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-09-14 20:54:19 +0200
commit351ffa462d2314c4b60369e2ba0f13b5d90f03b5 (patch)
tree3a65ef976872b6ca31f1c68998113dd25e80dc11 /layout/svg/nsSVGOuterSVGFrame.cpp
parent2fce053e98de11551df1afa69db7f127c44ef5f4 (diff)
downloadUXP-351ffa462d2314c4b60369e2ba0f13b5d90f03b5.tar
UXP-351ffa462d2314c4b60369e2ba0f13b5d90f03b5.tar.gz
UXP-351ffa462d2314c4b60369e2ba0f13b5d90f03b5.tar.lz
UXP-351ffa462d2314c4b60369e2ba0f13b5d90f03b5.tar.xz
UXP-351ffa462d2314c4b60369e2ba0f13b5d90f03b5.zip
Fix wrong SVG sizes with non-integer values for viewBox width/height.
Includes a standalone reftest.
Diffstat (limited to 'layout/svg/nsSVGOuterSVGFrame.cpp')
-rw-r--r--layout/svg/nsSVGOuterSVGFrame.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/layout/svg/nsSVGOuterSVGFrame.cpp b/layout/svg/nsSVGOuterSVGFrame.cpp
index aeadccbc5..e1b97bb40 100644
--- a/layout/svg/nsSVGOuterSVGFrame.cpp
+++ b/layout/svg/nsSVGOuterSVGFrame.cpp
@@ -241,8 +241,9 @@ nsSVGOuterSVGFrame::GetIntrinsicRatio()
nsSVGLength2 &height = content->mLengthAttributes[SVGSVGElement::ATTR_HEIGHT];
if (!width.IsPercentage() && !height.IsPercentage()) {
- nsSize ratio(NSToCoordRoundWithClamp(width.GetAnimValue(content)),
- NSToCoordRoundWithClamp(height.GetAnimValue(content)));
+ nsSize ratio(
+ nsPresContext::CSSPixelsToAppUnits(width.GetAnimValue(content)),
+ nsPresContext::CSSPixelsToAppUnits(height.GetAnimValue(content)));
if (ratio.width < 0) {
ratio.width = 0;
}
@@ -272,8 +273,8 @@ nsSVGOuterSVGFrame::GetIntrinsicRatio()
if (viewBoxHeight < 0.0f) {
viewBoxHeight = 0.0f;
}
- return nsSize(NSToCoordRoundWithClamp(viewBoxWidth),
- NSToCoordRoundWithClamp(viewBoxHeight));
+ return nsSize(nsPresContext::CSSPixelsToAppUnits(viewBoxWidth),
+ nsPresContext::CSSPixelsToAppUnits(viewBoxHeight));
}
return nsSVGDisplayContainerFrame::GetIntrinsicRatio();