ladybird/Tests/LibWeb/Text/input/css/CSSStyleDeclaration-modify-computed.html
Tim Ledbetter ea68bdef26 LibWeb: Return error on modification of a computed CSS style declaration
Previously, calling `setProperty` or `removeProperty` from JS on a
CSSStyleDeclaration returned from `getComputedStyle()` would return
null. We now return a NoModificationAllowedError instead, which aligns
our implementation with the specification.
2024-08-05 09:55:50 +02:00

19 lines
690 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<script>
test(() => {
try {
document.defaultView.getComputedStyle(document.documentElement, null).setProperty("foo", "bar");
println("FAIL");
} catch (e) {
println(`Calling setProperty() on a computed CSSStyleDeclaration throws error of type: ${e.name}`);
}
try {
document.defaultView.getComputedStyle(document.documentElement, null).removeProperty("foo");
println("FAIL");
} catch (e) {
println(`Calling removeProperty() on a computed CSSStyleDeclaration throws error of type: ${e.name}`);
}
});
</script>