LibWeb/CSS: Make CSSImportRule.media return its own MediaList

...instead of returning the one from its associated style sheet.

This reverts 848a250b29 where I made
`CSSImportRule.media` nullable.

CSSImportRule may not have an associated style sheet, because of not
matching a supports condition, or just failing to load the URL.
Regardless of whether we do or not, the expected (non-spec) behaviour
is that we should return a MediaList always, which matches the media
queries specified on the `@import` rule.
This commit is contained in:
Sam Atkins
2025-12-04 16:48:19 +00:00
parent 5d38a3639f
commit fbcaa8edde
Notes: github-actions[bot] 2025-12-08 13:32:06 +00:00
9 changed files with 48 additions and 46 deletions

View File

@@ -2,17 +2,17 @@ Harness status: OK
Found 13 tests
13 Fail
Fail @import url("nonexist.css") layer; should be a valid layered import rule
Fail @import url("nonexist.css") layer(A); should be a valid layered import rule
Fail @import url("nonexist.css") layer(A.B); should be a valid layered import rule
Fail @import url(nonexist.css) layer; should be a valid layered import rule
Fail @import url(nonexist.css) layer(A); should be a valid layered import rule
Fail @import url(nonexist.css) layer(A.B); should be a valid layered import rule
Fail @import "nonexist.css" layer; should be a valid layered import rule
Fail @import "nonexist.css" layer(A); should be a valid layered import rule
Fail @import "nonexist.css" layer(A.B); should be a valid layered import rule
Fail @import url("nonexist.css") layer(); should still be a valid import rule with an invalid layer declaration
Fail @import url("nonexist.css") layer(A B); should still be a valid import rule with an invalid layer declaration
Fail @import url("nonexist.css") layer(A . B); should still be a valid import rule with an invalid layer declaration
Fail @import url("nonexist.css") layer(A, B, C); should still be a valid import rule with an invalid layer declaration
13 Pass
Pass @import url("nonexist.css") layer; should be a valid layered import rule
Pass @import url("nonexist.css") layer(A); should be a valid layered import rule
Pass @import url("nonexist.css") layer(A.B); should be a valid layered import rule
Pass @import url(nonexist.css) layer; should be a valid layered import rule
Pass @import url(nonexist.css) layer(A); should be a valid layered import rule
Pass @import url(nonexist.css) layer(A.B); should be a valid layered import rule
Pass @import "nonexist.css" layer; should be a valid layered import rule
Pass @import "nonexist.css" layer(A); should be a valid layered import rule
Pass @import "nonexist.css" layer(A.B); should be a valid layered import rule
Pass @import url("nonexist.css") layer(); should still be a valid import rule with an invalid layer declaration
Pass @import url("nonexist.css") layer(A B); should still be a valid import rule with an invalid layer declaration
Pass @import url("nonexist.css") layer(A . B); should still be a valid import rule with an invalid layer declaration
Pass @import url("nonexist.css") layer(A, B, C); should still be a valid import rule with an invalid layer declaration