mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-14 02:46:22 +02:00
CSSStyleDeclaration has an indexed property getter, which returns properties associated with the object in the order they were specified in. (cherry picked from commit a94282e0e8dd344bcf94c1d098378bd46151ce47)
24 lines
1.0 KiB
HTML
24 lines
1.0 KiB
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
const bodyStyleDeclaration = getComputedStyle(document.body);
|
|
|
|
const serializedBodyComputedStyle = JSON.stringify(bodyStyleDeclaration, null, 4);
|
|
println("All properties associated with getComputedStyle(document.body):");
|
|
println(serializedBodyComputedStyle);
|
|
|
|
const serializedBodyElementStyle = JSON.stringify(document.body.style, null, 4);
|
|
println("All properties associated with document.body.style by default:");
|
|
println(serializedBodyElementStyle);
|
|
|
|
document.body.style.display = "none";
|
|
document.body.style.backgroundColor = "red";
|
|
document.body.style.fontSize = "15px";
|
|
|
|
const serializedBodyElementStyleWithSetProperties = JSON.stringify(document.body.style, null, 4);
|
|
println("All properties associated with document.body.style after setting some properties:");
|
|
println(serializedBodyElementStyleWithSetProperties);
|
|
});
|
|
</script>
|