mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:47:47 +00:00
LibWeb: Make CSSConditionRule.conditionText
read-only
Previously @media rule conditions could be updated by assigning to `conditionText`. This change aligns our implementation with the CSSOM specification, which says `CSSConditionRule.conditionText` should be read-only.
This commit is contained in:
parent
b08fd1b9ae
commit
4646a87eba
8 changed files with 29 additions and 15 deletions
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
@media not all {
|
||||
div { color: red; }
|
||||
}
|
||||
@supports not (unsupported-property: unsupported-value) {
|
||||
div { display: none; }
|
||||
}
|
||||
</style>
|
||||
<div>This text shouldn't be visible</div>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
const mediaRule = document.styleSheets[0].cssRules[0];
|
||||
println(`@media rule conditionText initial value: ${mediaRule.conditionText}`);
|
||||
mediaRule.conditionText = "all";
|
||||
println(`@media rule conditionText value after assignment: ${mediaRule.conditionText}`);
|
||||
|
||||
const supportsRule = document.styleSheets[0].cssRules[1];
|
||||
println(`@supports rule conditionText initial value: ${supportsRule.conditionText}`);
|
||||
mediaRule.conditionText = "(unsupported-property: unsupported-value)";
|
||||
println(`@supports rule conditionText value after assignment: ${supportsRule.conditionText}`);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue