mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
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.
This commit is contained in:
parent
08d60d7521
commit
ea68bdef26
Notes:
github-actions[bot]
2024-08-05 07:56:40 +00:00
Author: https://github.com/tcl3
Commit: ea68bdef26
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/964
5 changed files with 51 additions and 4 deletions
|
@ -0,0 +1,19 @@
|
|||
<!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>
|
Loading…
Add table
Add a link
Reference in a new issue