From f41592eb4aceadae747a3b4ba1a923c7d5423be3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= <canaltinova@gmail.com>
Date: Fri, 4 Aug 2017 17:36:18 -0700
Subject: [PATCH] Bug 1386848 - stylo: Get proper length value from calc
 nsCSSValue r=xidorn

We were getting the proper app units value for transform matrix offset before
Bug 1384656. But after that bug we started using GetCalcValue() method and
it wasn't converting length to app units and this was cousing to miscalculate
translate functions in transform property.

MozReview-Commit-ID: HHlrSg00252

--HG--
extra : rebase_source : dfc96f7905a8b501c0427519bbe5c2cb5010424e
---
 layout/style/nsCSSValue.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/layout/style/nsCSSValue.cpp b/layout/style/nsCSSValue.cpp
index 72a1e1103f3d7..a45954bd34ef6 100644
--- a/layout/style/nsCSSValue.cpp
+++ b/layout/style/nsCSSValue.cpp
@@ -873,7 +873,7 @@ nsCSSValue::GetCalcValue() const
   nsStyleCoord::CalcValue result;
 
   if (rootValue.GetUnit() == eCSSUnit_Pixel) {
-    result.mLength = rootValue.GetFloatValue();
+    result.mLength = rootValue.GetPixelLength();
     result.mPercent = 0.0f;
     result.mHasPercent = false;
   } else {
@@ -890,7 +890,7 @@ nsCSSValue::GetCalcValue() const
                "The first value should be eCSSUnit_Pixel");
     MOZ_ASSERT(percent.GetUnit() == eCSSUnit_Percent,
                "The first value should be eCSSUnit_Percent");
-    result.mLength = length.GetFloatValue();
+    result.mLength = length.GetPixelLength();
     result.mPercent = percent.GetPercentValue();
     result.mHasPercent = true;
   }
-- 
GitLab