• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html>
2<body>
3<script src="../resources/runner.js"></script>
4<script>
5// Use the threaded parser if available:
6if (window.internals && window.internals.settings.setThreadedHTMLParser)
7    window.internals.settings.setThreadedHTMLParser(true);
8
9var specURL = "resources/html5.html";
10
11var iframe = document.createElement("iframe");
12iframe.style.display = "none";  // Prevent creation of the rendering tree, so we only test HTML parsing.
13iframe.sandbox = '';  // Prevent external script loads which could cause write() to return before completing the parse.
14document.body.appendChild(iframe);
15
16PerfTestRunner.prepareToMeasureValuesAsync({done: onCompletedRun, unit: 'ms'});
17
18iframe.onload = function() {
19    var now = PerfTestRunner.now();
20    PerfTestRunner.measureValueAsync(now - then);
21    then = now;
22    iframe.src = specURL;
23}
24var then = PerfTestRunner.now();
25iframe.src = specURL;
26
27function onCompletedRun() {
28    iframe.onload = null;
29    // FIXME: This should probably remove the iframe, but that currently
30    // causes the threaded-parser to never send the load event for the main page.
31    // document.body.removeChild(iframe);
32}
33</script>
34</body>
35