LibWeb/CSS: Support inherit custom properties on :root

Make sure we have a parent element before trying to look at it!

I've also pulled out a stub function for getting a custom property's
initial value, so that there's only one place to change once we support
`@property` more.
This commit is contained in:
Sam Atkins 2025-07-14 12:50:58 +01:00 committed by Jelle Raaijmakers
commit b3abbeab89
Notes: github-actions[bot] 2025-07-15 08:37:17 +00:00
3 changed files with 28 additions and 8 deletions

View file

@ -0,0 +1 @@
PASS! (Didn't crash)

View file

@ -0,0 +1,12 @@
<!DOCTYPE html>
<style>
:root {
--example: unset;
}
</style>
<script src="../include.js"></script>
<script>
test(() => {
println("PASS! (Didn't crash)");
});
</script>