4 <title>Test media query list serialization
</title>
5 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
9 @media screen, PrInT, SPEECH {}
15 @media NotAValidMediaType_!
000 {}
16 @media NotAValidMediaType_!
000, AlsoInvalid!!!! {}
18 @media PrInT, GARbAGE7, notAValidMediaType_!
000 {}
20 <script type=
"application/javascript">
22 let expectedValues = [
24 [
"print",
"Valid media types are ascii lowercased."],
25 [
"screen, print, speech",
"Media query lists with only valid types are ascii lowercased."],
28 [
"garbage7",
"Invalid media types are ascii lowercased."],
29 [
"aaaaa",
"Ascii conversion handles 'A' correctly."],
30 [
"zzzzz",
"Ascii conversion handles 'Z' correctly."],
33 [
"not all",
"Malformed media types are serialized to 'not all'."],
34 [
"not all, not all",
"Multiple malformed media types are each serialized to 'not all'."],
37 [
"print, garbage7, not all",
"Media query lists with a mix of valid, invalid, and malformed types serialize " +
38 "as lowercase with malformed types changed to 'not all'."],
41 let sheet = document.styleSheets[
1];
43 expectedValues.forEach(function (entry, index) {
44 let rule = sheet.cssRules[index];
45 let serializedList = rule.media.mediaText;
46 is(serializedList, entry[
0], entry[
1]);