Tests/LibWeb: Print properties without indexes

The test CSSStyleDeclaration-has-indexed-property-getter is a frequent
source of merge conflicts between PRs that are adding to or otherwise
modifying the list of supported CSS properties.

This is primarily because the test prints out a numeric index of each
property along with the property. As far as I can tell the indexes are
inconsequential for what the test is trying to verify. So lets modify
the printout to only contain the properties without indexes.
This commit is contained in:
InvalidUsernameException 2025-06-01 19:32:24 +02:00 committed by Tim Ledbetter
commit 417f4edc46
Notes: github-actions[bot] 2025-06-01 18:10:16 +00:00
2 changed files with 251 additions and 252 deletions

View file

@ -2,22 +2,21 @@
<script src="../include.js"></script>
<script>
test(() => {
const bodyStyleDeclaration = getComputedStyle(document.body);
function printProperties(properties) {
println(JSON.stringify(Object.values(properties), null, 4));
}
const serializedBodyComputedStyle = JSON.stringify(bodyStyleDeclaration, null, 4);
println("All properties associated with getComputedStyle(document.body):");
println(serializedBodyComputedStyle);
printProperties(getComputedStyle(document.body));
const serializedBodyElementStyle = JSON.stringify(document.body.style, null, 4);
println("All properties associated with document.body.style by default:");
println(serializedBodyElementStyle);
printProperties(document.body.style);
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);
printProperties(document.body.style);
});
</script>