Index: PerformanceTests/Layout/AddWhitespace.html |
diff --git a/PerformanceTests/Layout/AddWhitespace.html b/PerformanceTests/Layout/AddWhitespace.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..52a4296fb2b400cdfee64f3d7e8bd23a34b3e60d |
--- /dev/null |
+++ b/PerformanceTests/Layout/AddWhitespace.html |
@@ -0,0 +1,28 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
esprehn
2015/05/04 22:14:38
Leave out html, head, body and title.
|
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
+ <title>Adding whitespace performance test</title> |
+ <script src="../resources/runner.js"></script> |
+</head> |
+<body> |
+ <pre id="log"></pre> |
+ <div id="test"></div> |
+ <script> |
+ var target = document.getElementById("test"); |
+ function test() { |
+ target.innerHTML = '<div style="display: inline-block;"></div>'; |
esprehn
2015/05/04 22:14:38
Why inline block?
|
+ for (var i = 0; i < 1000; i++) { |
+ var testElement = document.createTextNode(" "); |
esprehn
2015/05/04 22:14:38
This is not very realistic, pages don't have huge
|
+ target.insertBefore(testElement, target.firstChild); |
+ } |
+ document.body.offsetTop; |
+ } |
+ |
+ PerfTestRunner.measureRunsPerSecond({ |
+ description: "Is sensitive to the performance of layout when adding whitespace to a div.", |
+ run: test |
+ }); |
+ </script> |
+</body> |
+</html> |