| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 requestAnimationFrame(render); | 421 requestAnimationFrame(render); |
| 422 } else { | 422 } else { |
| 423 renderStats(); | 423 renderStats(); |
| 424 } | 424 } |
| 425 } | 425 } |
| 426 | 426 |
| 427 | 427 |
| 428 function Form() { | 428 function Form() { |
| 429 function create(tag) { return document.createElement(tag); } | 429 function create(tag) { return document.createElement(tag); } |
| 430 function text(value) { return document.createTextNode(value); } | 430 function text(value) { return document.createTextNode(value); } |
| 431 | 431 |
| 432 this.form = create("form"); | 432 this.form = create("form"); |
| 433 this.form.setAttribute("action", "javascript:start()"); | 433 this.form.setAttribute("action", "javascript:start()"); |
| 434 | 434 |
| 435 var table = create("table"); | 435 var table = create("table"); |
| 436 table.setAttribute("style", "margin-left: auto; margin-right: auto;"); | 436 table.setAttribute("style", "margin-left: auto; margin-right: auto;"); |
| 437 | 437 |
| 438 function col(a) { | 438 function col(a) { |
| 439 var td = create("td"); | 439 var td = create("td"); |
| 440 td.appendChild(a); | 440 td.appendChild(a); |
| 441 return td; | 441 return td; |
| 442 } | 442 } |
| 443 | 443 |
| 444 function row(a, b) { | 444 function row(a, b) { |
| 445 var tr = create("tr"); | 445 var tr = create("tr"); |
| 446 tr.appendChild(col(a)); | 446 tr.appendChild(col(a)); |
| 447 tr.appendChild(col(b)); | 447 tr.appendChild(col(b)); |
| 448 return tr; | 448 return tr; |
| 449 } | 449 } |
| 450 | 450 |
| 451 this.timelimit = create("input"); | 451 this.timelimit = create("input"); |
| 452 this.timelimit.setAttribute("value", "60"); | 452 this.timelimit.setAttribute("value", "60"); |
| 453 | 453 |
| 454 table.appendChild(row(text("Time limit in seconds"), this.timelimit)); | 454 table.appendChild(row(text("Time limit in seconds"), this.timelimit)); |
| 455 | 455 |
| 456 this.autoscale = create("input"); | 456 this.autoscale = create("input"); |
| 457 this.autoscale.setAttribute("type", "checkbox"); | 457 this.autoscale.setAttribute("type", "checkbox"); |
| 458 this.autoscale.setAttribute("checked", "true"); | 458 this.autoscale.setAttribute("checked", "true"); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 489 | 489 |
| 490 function start() { | 490 function start() { |
| 491 benchmarkTimeLimit = form.timelimit.value * 1000; | 491 benchmarkTimeLimit = form.timelimit.value * 1000; |
| 492 autoScale = form.autoscale.checked; | 492 autoScale = form.autoscale.checked; |
| 493 form.remove(); | 493 form.remove(); |
| 494 init(); | 494 init(); |
| 495 render(); | 495 render(); |
| 496 } | 496 } |
| 497 | 497 |
| 498 var form = new Form(); | 498 var form = new Form(); |
| OLD | NEW |