Commit cde33082 authored by Oriol Brufau's avatar Oriol Brufau Committed by Commit Bot

[css-grid] Add perf test for deeply nested grids

r815289 fixed a performance regression affecting deeply nested grids.
This patch adds a perf test to cover that case. Locally it measures a
performance improvement of +37,324.2% when applying r815289.

Bug: 1136474
Change-Id: I2dfd731cfb4d571146e256bb97d6e33146a7039b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2488480Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/master@{#819097}
parent b15f47df
<!DOCTYPE html>
<style>
.grid {
display: grid;
}
.gridItem {
min-height: 0;
min-width: 0;
}
</style>
<script src="../resources/runner.js"></script>
<script>
'use strict';
function startTest() {
let root;
PerfTestRunner.measureRunsPerSecond({
description: "Measures performance of layout on a page using deeply nested grids.",
setup() {
let node = document.createElement("div");
node.className = "gridItem";
node.textContent = "Inner contents";
for (let i = 0; i < 16; ++i) {
let parent = document.createElement("div");
parent.className = "grid gridItem";
parent.appendChild(node);
node = parent;
}
root = node;
root.className = "grid";
document.body.appendChild(root);
PerfTestRunner.forceLayout();
},
run() {
root.style.display = "none";
PerfTestRunner.forceLayout();
root.style.display = "";
PerfTestRunner.forceLayout();
},
});
}
</script>
<body onload="startTest()"></body>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment