Perform length unit conversion in a single place

Unit conversion happens in

UserSpaceMetrics::ResolveAbsoluteUnit
SVGLength::GetUserUnitsPerUnit
SVGAnimatedLength::GetPixelsPerUnit

If we do all the conversion in one place it's all much simpler if we want to add more units.

We also want to standardise naming so that we don't use UserUnits for some methods and Pixels for others so let's standardise on Pixels.

Differential Revision: https://phabricator.services.mozilla.com/D179438

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1835622
gecko-commit: e57010a0b90c71f7f34321e166bcf21402d9be00
gecko-reviewers: emilio
diff --git a/svg/types/scripted/SVGLength-px.html b/svg/types/scripted/SVGLength-px.html
index 65cf97c..2627b78 100644
--- a/svg/types/scripted/SVGLength-px.html
+++ b/svg/types/scripted/SVGLength-px.html
@@ -72,7 +72,7 @@
   var referenceValue = 48 * 2.54 / cssPixelsPerInch;
   assert_equals(length.valueAsString, referenceValue.toFixed(2) + "cm");
   assert_approx_equals(length.valueInSpecifiedUnits, referenceValue, 0.01);
-  assert_approx_equals(length.value, 48, 0.001);
+  assert_equals(length.value, 48);
   assert_equals(length.unitType, SVGLength.SVG_LENGTHTYPE_CM);
 }, document.title + ", cm");