servo/tests/blink_perf_tests/perf_tests/layout/flexbox-row-stretch-height-definite.html
Jonathan Schwender ee781b71b4
tests: Vendor blink perf tests (#38654)
Vendors the [blink perf
tests](https://chromium.googlesource.com/chromium/src/+/HEAD/third_party/blink/perf_tests/).
These perf tests are useful to evaluate the performance of servo. 
The license that governs the perf tests is included in the folder. 
Running benchmark cases automatically is left to future work.

The update.py script is taken from mozjs and slightly adapted, so we can
easily filter
(and patch if this should be necessary in the future.

Testing: This PR just adds the perf_tests, but does not use or modify
them in any way.

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-08-17 09:54:04 +00:00

41 lines
1.2 KiB
HTML
Vendored

<!DOCTYPE html>
<html>
<head>
<script src="../resources/runner.js"></script>
</head>
<body style="overflow-y: scroll">
<div id="flexbox-outer" style="display: flex; width: 512px; height: 256px">
<div id="neighbor" style="width: 256px">
</div>
<div id="flexbox-inner" style="flex-direction: column; overflow: auto">
<div id="contents" style="height: 100%; overflow: hidden">
</div>
</div>
</div>
</body>
<script>
// Add wrapping text to make the relayout from scrollbar positioning more expensive.
const contents = document.querySelector('#contents');
for (let i = 0; i < 1000; i++) {
contents.innerHTML += '<div>this text should wrap so a change in its container width triggers a relayout</div>';
}
const neighbor = document.querySelector("#neighbor");
function runTest()
{
neighbor.innerHTML = "changing this element's contents should not relayout the right flexbox";
PerfTestRunner.forceLayout();
neighbor.innerHTML = "";
PerfTestRunner.forceLayout();
}
PerfTestRunner.measureRunsPerSecond({
description: "Measures performance of definite-height flexbox that stretches its children's height (row).",
run: runTest,
});
</script>
</html>