LibWeb: Map logical aliases at compute rather than cascade time

This requires us to front load computation of writing-mode and direction
before we encounter any logical aliases or their physical counterparts
so that we can create a mapping context.

Doing this at compute rather than cascade time achieves a few things:
 1) Brings us into line with the spec
 2) Avoids the double cascade that was previously required to compute
    mapping contexts
 3) We now compute values of logical aliases, while
    `style_value_for_computed_property` maps logical aliases to their
    physical counterparts, this didn't account for all cases (i.e. if
    there was no layout node, Typed OM, etc).
 4) Removes a hurdle to moving other upstream processes (i.e. arbitrary
    substitution function resolution, custom property computation) to
    compute time as the spec requires.
This commit is contained in:
Callum Law
2026-03-16 17:51:24 +13:00
committed by Sam Atkins
parent 127d10c048
commit 500ca417ce
Notes: github-actions[bot] 2026-03-25 12:54:31 +00:00
7 changed files with 89 additions and 82 deletions

View File

@@ -0,0 +1,14 @@
<!doctype html>
<script src="../include.js"></script>
<style>
#target {
display: none;
padding-inline-start: 12px;
}
</style>
<div id="target"></div>
<script>
test(() => {
println(getComputedStyle(target).paddingInlineStart);
});
</script>