Revision 28d63f19babbd14a18a0219acf21362fc5d52dbc authored by Henrik Skupin on 28 March 2018, 18:49:31 UTC, committed by moz-wptsync-bot on 28 March 2018, 18:49:31 UTC
To retrieve links via "link text" or "partial link text" the rendered
content of the element has to be used. This can be the case for CSS
transformations like "uppercase".
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1381519
gecko-commit: 3e204686f1b10441f48435890241dff6706d04dd
gecko-integration-branch: central
gecko-reviewers: ato
1 parent f5b48cf
Raw File
timing-attack.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>window.performance.now should not enable timing attacks</title>
<link rel="author" title="W3C" href="http://www.w3.org/" />
<link rel="help" href="http://w3c.github.io/hr-time/#privacy-security"/>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(function() {
  function check_resolutions(times, length) {
    var end = length - 2;

    // we compare each value with the following ones
    for (var i = 0; i < end; i++) {
      var h1 = times[i];
      for (var j = i+1; j < end; j++) {
        var h2 = times[j];
        var diff = h2 - h1;
        assert_true((diff === 0) || ((diff * 1000) >= 5),
          "Differences smaller than 5 microseconds: " + diff);
      }
    }
    return true;
  }

  var times = new Array(10);
  var index = 0;
  var hrt1, hrt2, hrt;

  // rapid firing of performance.now
  hrt1 = performance.now();
  hrt2 = performance.now();
  times[index++] = hrt1;
  times[index++] = hrt2;

  // ensure that we get performance.now() to return a different value
  do {
    hrt = performance.now();
    times[index++] = hrt;
  } while ((hrt - hrt1) === 0);

  assert_true(check_resolutions(times, index), 'Difference should be at least 5 microseconds.');
}, 'The recommended minimum resolution of the Performance interface has been set to 5 microseconds');
</script>
</head>
<body>
<h1>Description</h1>
<p>The recommended minimum resolution of the Performance interface should be set to 5 microseconds.</p>

<div id="log"></div>

</body>
</html>
back to top