mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
Per the CSSOM specification, throw a NotFoundError DOMException when the specified medium is not found in the collection. Invalid input that fails to parse continues to return silently per step 2.
32 lines
877 B
HTML
32 lines
877 B
HTML
<!DOCTYPE html>
|
|
<style>
|
|
@media screen, print { body { color: red; } }
|
|
</style>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
let sheet = document.styleSheets[0];
|
|
let mediaList = sheet.cssRules[0].media;
|
|
|
|
println(`Initial: ${mediaList.mediaText}`);
|
|
println(`Length: ${mediaList.length}`);
|
|
|
|
mediaList.deleteMedium("print");
|
|
println(`After removing print: ${mediaList.mediaText}`);
|
|
println(`Length: ${mediaList.length}`);
|
|
|
|
try {
|
|
mediaList.deleteMedium("print");
|
|
} catch (e) {
|
|
println(`Remove nonexistent throws: ${e.name}`);
|
|
}
|
|
println(`Unchanged: ${mediaList.mediaText}`);
|
|
|
|
try {
|
|
mediaList.deleteMedium("not-a-real-type");
|
|
} catch (e) {
|
|
println(`Remove unknown throws: ${e.name}`);
|
|
}
|
|
});
|
|
</script>
|