mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-11-08 09:11:01 +00:00
30 lines
684 B
HTML
30 lines
684 B
HTML
|
|
<!DOCTYPE html>
|
||
|
|
<script src="./include.js"></script>
|
||
|
|
<style>
|
||
|
|
body {
|
||
|
|
--color: red;
|
||
|
|
}
|
||
|
|
body.green {
|
||
|
|
--color: green;
|
||
|
|
}
|
||
|
|
</style>
|
||
|
|
<body></body>
|
||
|
|
<script>
|
||
|
|
test(() => {
|
||
|
|
const div = document.createElement('div');
|
||
|
|
document.body.appendChild(div);
|
||
|
|
|
||
|
|
div.style["backgroundColor"] = "var(--color)";
|
||
|
|
div.style["width"] = "100px";
|
||
|
|
div.style["height"] = "100px";
|
||
|
|
|
||
|
|
const bgColorBefore = getComputedStyle(div).backgroundColor;
|
||
|
|
|
||
|
|
document.body.className = "green";
|
||
|
|
const bgColorAfter = getComputedStyle(div).backgroundColor;
|
||
|
|
|
||
|
|
println(bgColorBefore);
|
||
|
|
println(bgColorAfter);
|
||
|
|
});
|
||
|
|
</script>
|