Bug 1207734 - Part 9.e. (testing) Add specified value serialization test cases for individual transform.
authorcku <cku@mozilla.com>
Wed, 10 Jan 2018 15:04:00 +0800
changeset 1395215 42d9cd9da5dde1a28fdacf5e3f29f07840870477
parent 1395214 3245261848996ea8b323bec10c1fac5696ddd702
child 1395216 ddb4e0779e8ffc0db2dabaf2dd2c3c819d1723d9
push id245851
push usercku@mozilla.com
push dateFri, 12 Jan 2018 02:16:20 +0000
treeherdertry@539f9c76d6c2 [default view] [failures only]
bugs1207734
milestone59.0a1
Bug 1207734 - Part 9.e. (testing) Add specified value serialization test cases for individual transform.
layout/style/test/test_specified_value_serialization.html
--- a/layout/style/test/test_specified_value_serialization.html
+++ b/layout/style/test/test_specified_value_serialization.html
@@ -272,12 +272,58 @@
 
   p.style.paintOrder = "markers";
   is(p.style.paintOrder, "markers",
      "specified value serialization for paint-order doesn't contain repetitive values");
 
   p.remove();
 })();
 
+if (SpecialPowers.getBoolPref("layout.css.individual-transform.enabled")) {
+  (function test_bug_1207734 () {
+    // Test for rotate property serialization.
+    [
+      [" 90deg ", "90deg"],
+      [" 100grad ", "100grad"],
+      [" 100gRaD ", "100grad"],
+      [" 0.25turn  ", "0.25turn"],
+      [" 0.25tUrN  ", "0.25turn"],
+      [" 1.57RaD  ", "1.57rad"],
+    ].forEach(function(arr) {
+      document.documentElement.style.rotate = arr[0];
+      is(document.documentElement.style.rotate, arr[1],
+        "bug-1207734: incorrect rotate serialization");
+    });
+    document.documentElement.style.rotate = "";
+
+    // Test for translate property serialization.
+    [
+      [" 50% 5px 6px ", "50% 5px 6px"],
+      [" 50% 10px 100px ", "50% 10px 100px"],
+      [" 4px 5px ", "4px 5px"],
+      [" 10% 10% 99px  ", "10% 10% 99px"],
+      ["   50px    ", "50px"],
+    ].forEach(function(arr) {
+      document.documentElement.style.translate = arr[0];
+      is(document.documentElement.style.translate, arr[1],
+        "bug-1207734: incorrect translate serialization");
+    });
+    document.documentElement.style.translate = "";
+
+    // Test for scale property serialization.
+    [
+      [" 10  ", "10"],
+      [" 10 20.5 ", "10 20.5"],
+      [" 10 20  30 ", "10 20 30"],
+    ].forEach(function(arr) {
+      document.documentElement.style.scale = arr[0];
+      is(document.documentElement.style.scale, arr[1],
+        "bug-1207734: incorrect scale serialization");
+    });
+    document.documentElement.style.scale = "";
+
+  })();
+}
+
 </script>
 </pre>
 </body>
 </html>