Add another incremental layout that starts at stacking tree construction (#37088)

This allows to skip rebuilding the box tree when it's only necessary to
rebuild the stacking context tree.
Bumps Stylo to https://github.com/servo/stylo/pull/187

Testing: Unneeded (no behavior change). Just improving performance.
However, this adds a new test for dynamic changes of `z-index`, which we
were breaking in an earlier iteration of this patch.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Oriol Brufau 2025-05-24 01:40:02 +02:00 committed by GitHub
parent 1f5087d773
commit d18000fee8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 78 additions and 22 deletions

View file

@ -119171,6 +119171,19 @@
{}
]
],
"z-index-020.html": [
"34a7272a2541e779c487fe3501d6e6cd3f751f51",
[
null,
[
[
"/css/reference/ref-filled-green-200px-square.html",
"=="
]
],
{}
]
],
"z-index-abspos-001.xht": [
"63a44d15a7dce6e1a2df6124ff1064d0a68392ab",
[

View file

@ -0,0 +1,39 @@
<!DOCTYPE html>
<html class="reftest-wait">
<title>CSS Test: z-index - dynamic changes</title>
<link rel="author" title="Oriol Brufau" href="obrufau@igalia.com">
<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#z-index" />
<link rel="match" href="../../reference/ref-filled-green-200px-square.html">
<meta name="assert" content="Checks that z-index can be changed dynamically.">
<style>
div {
width: 200px;
height: 200px;
position: absolute;
}
#red {
background: red;
}
#target {
background: green;
z-index: -1;
}
#target.front {
z-index: 1;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div id="red"></div>
<div id="target"></div>
<script src="/common/reftest-wait.js"></script>
<script src="/common/rendering-utils.js"></script>
<script>
waitForAtLeastOneFrame().then(() => {
document.getElementById("target").className = "front";
takeScreenshot();
});
</script>
</html>