Chromium Code Reviews| Index: PerformanceTests/Layout/line-layout-line-height.html |
| diff --git a/PerformanceTests/Layout/line-layout-line-height.html b/PerformanceTests/Layout/line-layout-line-height.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cd9f9695bdfee55512f6f18ec5354822ea944888 |
| --- /dev/null |
| +++ b/PerformanceTests/Layout/line-layout-line-height.html |
| @@ -0,0 +1,35 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| + <title>Line height calculation performance test</title> |
|
Julien - ping for review
2014/04/28 20:11:38
Can't we dump this into the test or would this imp
|
| + <script src="../resources/runner.js"></script> |
| +</head> |
| +<body> |
| + <pre id="log"></pre> |
| + <div id="target" style="width: 300px; display: none;"> |
| + </div> |
| + <script> |
| + var target = document.getElementById("target"); |
| + var style = target.style; |
| + var rows = 10000; |
|
Julien - ping for review
2014/04/28 20:11:38
s/rows/lines/?
|
| + var el = document.createElement('p'); |
| + el.innerHTML = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris ut elit lacus, non convallis odio. Integer facilisis, dolor quis porttitor auctor\n'; |
| + for (var i = 0; i < rows; ++i) { |
| + var e = el.cloneNode(true); |
| + target.appendChild(e); |
| + } |
| + function test() { |
| + style.display = "block"; |
|
Julien - ping for review
2014/04/28 20:11:38
FWIW you are also checking the attachment / detach
|
| + style.width = "280px"; |
| + target.offsetLeft; |
| + style.width = "300px"; |
| + target.offsetLeft; |
| + style.width = "290px"; |
| + target.offsetLeft; |
| + style.display = "none"; |
| + } |
| + |
| + PerfTestRunner.measureTime({ run: test }); |
|
Julien - ping for review
2014/04/28 20:11:38
I think it's preferred to measure runs per seconds
|
| + </script> |
| +</body> |
| +</html> |