Bug 1638325 [wpt PR 23633] - Remove documents.fonts.ready workaround, a=testonly
authorRob Buis <rbuis@igalia.com>
Thu, 21 May 2020 10:21:16 +0000
changeset 532010 7023364d436df85273f70c995785440a96e9c7ce
parent 532009 1e5dd41f8ad061ee1fc342f0f27aeebb0d75a577
child 532011 a736f44faedaaa37f53ef9b4bd829836ab3293d0
push id37449
push userncsoregi@mozilla.com
push dateTue, 26 May 2020 02:38:57 +0000
treeherdermozilla-central@da2c7b0ac9a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1638325, 23633
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1638325 [wpt PR 23633] - Remove documents.fonts.ready workaround, a=testonly Automatic update from web-platform-tests Remove documents.fonts.ready workaround (#23633) Remove documents.fonts.ready workaround since the WebKit bug has been fixed. -- wpt-commits: 8d126975963efaf11efa210ce28c4f6a3d7faa21 wpt-pr: 23633
testing/web-platform/tests/css/css-fonts/math-script-level-and-math-style/math-script-level-004.tentative.html
--- a/testing/web-platform/tests/css/css-fonts/math-script-level-and-math-style/math-script-level-004.tentative.html
+++ b/testing/web-platform/tests/css/css-fonts/math-script-level-and-math-style/math-script-level-004.tentative.html
@@ -44,123 +44,120 @@
       .level2 { font-size: scriptlevel(2); }
       .level3 { font-size: scriptlevel(3); }
       .level5 { font-size: scriptlevel(5); }
     </style>
     <script>
       const big = 3000;
       const small = 150;
       setup({ explicit_done: true });
-      window.addEventListener("load", function() {
-        // Delay the check to workaround WebKit's bug https://webkit.org/b/174030.
-        requestAnimationFrame(() => { document.fonts.ready.then(runTests); });
-      });
       function fontSize(element) {
           return parseFloat((/(.+)px/).exec(getComputedStyle(element).
                                             getPropertyValue("font-size"))[1]);
       }
       function CheckFontSizes(id, sizes) {
           var container = document.getElementById(id);
           for (var level in sizes) {
               var divs = container.getElementsByClassName(`level${level}`);
               for (var i = 0; i < divs.length; i++) {
                   assert_approx_equals(fontSize(divs[i]), sizes[level], 1, `Wrong font-size (id=${id} ; level=${level} ; i=${i})`);
               }
           }
       }
-      function runTests() {
+      window.addEventListener("load", function() {
+          document.fonts.ready.then(function() {
+              test(function() {
+                  CheckFontSizes("scale80-40-scaledown", {
+                      "-3": big,
+                      "-1": big * .71 * .71,
+                      "0": big * .71 * .71 * .71,
+                      "1": big * .71 * .71 * .71 * .8,
+                      "2": big * .71 * .71 * .71 * .4,
+                      "3": big * .71 * .71 * .71 * .4 * .71,
+                      "5": big * .71 * .71 * .71 * .4 * .71 * .71 * .71
+                  });
+                  CheckFontSizes("scale80-40-scaleup", {
+                      "5": small,
+                      "3": small / (.71 * .71),
+                      "2": small / (.71 * .71 * .71),
+                      "1": small / (.71 * .71 * .71 * (.4 / .8)),
+                      "0": small  / (.71 * .71 * .71 * .4),
+                      "-1": small / (.71 * .71 * .71 * .4 * .71),
+                      "-3": small / (.71 * .71 * .71 * .4 * .71 * .71 * .71)
+                  });
+              }, "scriptPercentScaleDown=80, scriptScriptPercentScaleDown=40");
 
-          test(function() {
-              CheckFontSizes("scale80-40-scaledown", {
-                  "-3": big,
-                  "-1": big * .71 * .71,
-                  "0": big * .71 * .71 * .71,
-                  "1": big * .71 * .71 * .71 * .8,
-                  "2": big * .71 * .71 * .71 * .4,
-                  "3": big * .71 * .71 * .71 * .4 * .71,
-                  "5": big * .71 * .71 * .71 * .4 * .71 * .71 * .71
-              });
-              CheckFontSizes("scale80-40-scaleup", {
-                  "5": small,
-                  "3": small / (.71 * .71),
-                  "2": small / (.71 * .71 * .71),
-                  "1": small / (.71 * .71 * .71 * (.4 / .8)),
-                  "0": small  / (.71 * .71 * .71 * .4),
-                  "-1": small / (.71 * .71 * .71 * .4 * .71),
-                  "-3": small / (.71 * .71 * .71 * .4 * .71 * .71 * .71)
-              });
-          }, "scriptPercentScaleDown=80, scriptScriptPercentScaleDown=40");
-
-          test(function() {
-              var scriptPercentScaleDown = .71;
-              CheckFontSizes("scale0-40-scaledown", {
-                  "-3": big,
-                  "-1": big * .71 * .71,
-                  "0": big * .71 * .71 * .71,
-                  "1": big * .71 * .71 * .71 * scriptPercentScaleDown,
-                  "2": big * .71 * .71 * .71 * .4,
-                  "3": big * .71 * .71 * .71 * .4 * .71,
-                  "5": big * .71 * .71 * .71 * .4 * .71 * .71 * .71
-              });
-              CheckFontSizes("scale0-40-scaleup", {
-                  "5": small,
-                  "3": small / (.71 * .71),
-                  "2": small / (.71 * .71 * .71),
-                  "1": small / (.71 * .71 * .71 * (.4 / scriptPercentScaleDown)),
-                  "0": small  / (.71 * .71 * .71 * .4),
-                  "-1": small / (.71 * .71 * .71 * .4 * .71),
-                  "-3": small / (.71 * .71 * .71 * .4 * .71 * .71 * .71)
-              });
-          }, "scriptPercentScaleDown=0, scriptScriptPercentScaleDown=40");
+              test(function() {
+                  var scriptPercentScaleDown = .71;
+                  CheckFontSizes("scale0-40-scaledown", {
+                      "-3": big,
+                      "-1": big * .71 * .71,
+                      "0": big * .71 * .71 * .71,
+                      "1": big * .71 * .71 * .71 * scriptPercentScaleDown,
+                      "2": big * .71 * .71 * .71 * .4,
+                      "3": big * .71 * .71 * .71 * .4 * .71,
+                      "5": big * .71 * .71 * .71 * .4 * .71 * .71 * .71
+                  });
+                  CheckFontSizes("scale0-40-scaleup", {
+                      "5": small,
+                      "3": small / (.71 * .71),
+                      "2": small / (.71 * .71 * .71),
+                      "1": small / (.71 * .71 * .71 * (.4 / scriptPercentScaleDown)),
+                      "0": small  / (.71 * .71 * .71 * .4),
+                      "-1": small / (.71 * .71 * .71 * .4 * .71),
+                      "-3": small / (.71 * .71 * .71 * .4 * .71 * .71 * .71)
+                  });
+              }, "scriptPercentScaleDown=0, scriptScriptPercentScaleDown=40");
 
-          test(function() {
-              var scriptScriptPercentScaleDown = 0.5041;
-              CheckFontSizes("scale80-0-scaledown", {
-                  "-3": big,
-                  "-1": big * .71 * .71,
-                  "0": big * .71 * .71 * .71,
-                  "1": big * .71 * .71 * .71 * .8,
-                  "2": big * .71 * .71 * .71 * scriptScriptPercentScaleDown,
-                  "3": big * .71 * .71 * .71 * scriptScriptPercentScaleDown * .71,
-                  "5": big * .71 * .71 * .71 * scriptScriptPercentScaleDown * .71 * .71 * .71
-              });
-              CheckFontSizes("scale80-0-scaleup", {
-                  "5": small,
-                  "3": small / (.71 * .71),
-                  "2": small / (.71 * .71 * .71),
-                  "1": small / (.71 * .71 * .71 * (scriptScriptPercentScaleDown / .8)),
-                  "0": small  / (.71 * .71 * .71 * scriptScriptPercentScaleDown),
-                  "-1": small / (.71 * .71 * .71 * scriptScriptPercentScaleDown * .71),
-                  "-3": small / (.71 * .71 * .71 * scriptScriptPercentScaleDown * .71 * .71 * .71)
-              });
-          }, "scriptPercentScaleDown=80, scriptScriptPercentScaleDown=0");
+              test(function() {
+                  var scriptScriptPercentScaleDown = 0.5041;
+                  CheckFontSizes("scale80-0-scaledown", {
+                      "-3": big,
+                      "-1": big * .71 * .71,
+                      "0": big * .71 * .71 * .71,
+                      "1": big * .71 * .71 * .71 * .8,
+                      "2": big * .71 * .71 * .71 * scriptScriptPercentScaleDown,
+                      "3": big * .71 * .71 * .71 * scriptScriptPercentScaleDown * .71,
+                      "5": big * .71 * .71 * .71 * scriptScriptPercentScaleDown * .71 * .71 * .71
+                  });
+                  CheckFontSizes("scale80-0-scaleup", {
+                      "5": small,
+                      "3": small / (.71 * .71),
+                      "2": small / (.71 * .71 * .71),
+                      "1": small / (.71 * .71 * .71 * (scriptScriptPercentScaleDown / .8)),
+                      "0": small  / (.71 * .71 * .71 * scriptScriptPercentScaleDown),
+                      "-1": small / (.71 * .71 * .71 * scriptScriptPercentScaleDown * .71),
+                      "-3": small / (.71 * .71 * .71 * scriptScriptPercentScaleDown * .71 * .71 * .71)
+                  });
+              }, "scriptPercentScaleDown=80, scriptScriptPercentScaleDown=0");
 
-          test(function() {
-              CheckFontSizes("default-scaledown", {
-                  "-3": big,
-                  "-1": big * .71 * .71,
-                  "0": big * .71 * .71 * .71,
-                  "1": big * .71 * .71 * .71 * .71,
-                  "2": big * .71 * .71 * .71 * .71 * .71,
-                  "3": big * .71 * .71 * .71 * .71 * .71 * .71,
-                  "5": big * .71 * .71 * .71 * .71 * .71 * .71 * .71 * .71
-              });
-              CheckFontSizes("default-scaleup", {
-                  "5": small,
-                  "3": small / (.71 * .71),
-                  "2": small / (.71 * .71 * .71),
-                  "1": small / (.71 * .71 * .71 * .71),
-                  "0": small  / (.71 * .71 * .71 * .71 * .71),
-                  "-1": small / (.71 * .71 * .71 * .71 * .71 * .71),
-                  "-3": small / (.71 * .71 * .71 * .71 * .71 * .71 * .71 * .71)
-              });
-          }, "No MATH table");
+              test(function() {
+                  CheckFontSizes("default-scaledown", {
+                      "-3": big,
+                      "-1": big * .71 * .71,
+                      "0": big * .71 * .71 * .71,
+                      "1": big * .71 * .71 * .71 * .71,
+                      "2": big * .71 * .71 * .71 * .71 * .71,
+                      "3": big * .71 * .71 * .71 * .71 * .71 * .71,
+                      "5": big * .71 * .71 * .71 * .71 * .71 * .71 * .71 * .71
+                  });
+                  CheckFontSizes("default-scaleup", {
+                      "5": small,
+                      "3": small / (.71 * .71),
+                      "2": small / (.71 * .71 * .71),
+                      "1": small / (.71 * .71 * .71 * .71),
+                      "0": small  / (.71 * .71 * .71 * .71 * .71),
+                      "-1": small / (.71 * .71 * .71 * .71 * .71 * .71),
+                      "-3": small / (.71 * .71 * .71 * .71 * .71 * .71 * .71 * .71)
+                  });
+              }, "No MATH table");
 
-          done();
-      }
+              done();
+          });
+      });
     </script>
   </head>
   <body>
     <div id="log"></div>
 
     <div class="level-3" id="scale80-40-scaledown">
       <div class="big">
         <div class="level5"><!-- -3 to 5 --></div>