LibWeb: Check navigable container for whether element needs style update

The style of an element depends on it's navigable's viewport size which
in turn depends on the navigable's container's style - so if requires a
style update then so does the original element.
This commit is contained in:
Callum Law
2026-03-02 14:37:49 +13:00
committed by Sam Atkins
parent 7f3b8bb587
commit 33c0e55762
Notes: github-actions[bot] 2026-03-09 14:37:47 +00:00
3 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<!doctype html>
<style>
iframe {
width: 50px;
height: 0px;
}
</style>
<iframe
id="iframe"
srcdoc="
<div id=target></div>
<style>
#target {
order: calc(100vh / 1px);
}
</style>
"
></iframe>
<script src="../include.js"></script>
<script>
asyncTest(done => {
iframe.addEventListener("load", () => {
requestAnimationFrame(() => {
requestAnimationFrame(() => {
const target = iframe.contentDocument.querySelector("#target");
println(getComputedStyle(target).order);
for (let height of [1, 2, 3]) {
iframe.style.height = `${height}px`;
println(getComputedStyle(target).order);
}
done();
});
});
});
});
</script>