Index: PerformanceTests/Layout/grid-add-positioned-items.html |
diff --git a/PerformanceTests/Layout/grid-add-positioned-items.html b/PerformanceTests/Layout/grid-add-positioned-items.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..43e9c97e46d55adf9f38ac92728cfa7392448e74 |
--- /dev/null |
+++ b/PerformanceTests/Layout/grid-add-positioned-items.html |
@@ -0,0 +1,49 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<style> |
+ #log { |
+ position: fixed; |
+ } |
+</style> |
+<script src="../resources/runner.js"></script> |
+<body> |
+ <pre id="log"></pre> |
+ <script> |
+ function addGridItems(grid, tracksCount) { |
+ for (row = 1; row <= tracksCount; row++) { |
+ for (column = 1; column <= tracksCount; column++) { |
+ var item = document.createElement("div"); |
+ item.style.gridRow = row; |
+ item.style.gridColumn = column; |
+ item.innerHTML = "row: " + row + " - column: " + column; |
+ grid.appendChild(item); |
+ } |
+ } |
+ } |
+ |
+ function createGridTest(tracksCount) { |
+ var grid = document.createElement("div"); |
+ grid.style.display = "grid"; |
+ grid.style.gridTemplateColumns = "repeat(" + tracksCount + ", 50px)"; |
+ grid.style.gridTemplateRows = "repeat(" + tracksCount + ", 50px)"; |
+ document.body.appendChild(grid); |
+ |
+ return { |
+ description: "Testing addition of positioned items on a " + tracksCount + "x" + tracksCount + " grid.", |
+ run: function() { |
+ addGridItems(grid, tracksCount); |
+ }, |
+ setup: function() { |
+ grid.innerHTML = ""; |
+ }, |
+ done: function() { |
+ document.body.removeChild(grid); |
+ } |
+ }; |
+ } |
+ |
+ PerfTestRunner.measureTime(createGridTest(100)); |
+ </script> |
+</body> |
+</html> |