Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: LayoutTests/fast/media/mq-append-delete.html

Issue 15679021: Parse media attributes and CSSOM media text as media_query_list. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review issues. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <style type="text/css">@media screen { }</style> 2 <style type="text/css">@media screen { }</style>
3 <script src="../../resources/testharness.js"></script> 3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script> 4 <script src="../../resources/testharnessreport.js"></script>
5 <div id=log></div> 5 <div id=log></div>
6 <script> 6 <script>
7 var rules = document.styleSheets[0].cssRules; 7 var rules = document.styleSheets[0].cssRules;
8 var mediaList = rules.item(0).media; 8 var mediaList = rules.item(0).media;
9 9
10 // - appendMedium() 10 // - appendMedium()
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 mediaList.mediaText = "screen, tv"; 60 mediaList.mediaText = "screen, tv";
61 mediaList.appendMedium(","); 61 mediaList.appendMedium(",");
62 assert_equals(mediaList.mediaText, "screen, tv"); 62 assert_equals(mediaList.mediaText, "screen, tv");
63 // CSSOM 4.1: Parsing media query returns none as 63 // CSSOM 4.1: Parsing media query returns none as
64 // there are more than one; terminate steps. 64 // there are more than one; terminate steps.
65 }, "Add ',' to 'screen, tv'"); 65 }, "Add ',' to 'screen, tv'");
66 66
67 test(function () { 67 test(function () {
68 mediaList.mediaText = "screen, tv"; 68 mediaList.mediaText = "screen, tv";
69 mediaList.appendMedium("&invalid"); 69 mediaList.appendMedium("&invalid");
70 assert_equals(mediaList.mediaText, "screen, tv"); 70 assert_equals(mediaList.mediaText, "screen, tv, not all");
71 // Ignored; terminate steps. 71 // Ignored; terminate steps.
72 }, "Add '&invalid' to 'screen, tv'"); 72 }, "Add '&invalid' to 'screen, tv'");
73 73
74 test(function () { 74 test(function () {
75 mediaList.mediaText = "screen, tv"; 75 mediaList.mediaText = "screen, tv";
76 mediaList.appendMedium("not all"); 76 mediaList.appendMedium("not all");
77 assert_equals(mediaList.mediaText, "screen, tv, not all"); 77 assert_equals(mediaList.mediaText, "screen, tv, not all");
78 }, "Add 'not all' to 'screen, tv'"); 78 }, "Add 'not all' to 'screen, tv'");
79 79
80 test(function () { 80 test(function () {
81 mediaList.mediaText = "screen, tv"; 81 mediaList.mediaText = "screen, tv";
82 mediaList.appendMedium("#?:/"); 82 mediaList.appendMedium("#?:/");
83 assert_equals(mediaList.mediaText, "screen, tv"); 83 assert_equals(mediaList.mediaText, "screen, tv, not all");
84 // Ignored; terminate steps. 84 // Ignored; terminate steps.
85 }, "Add '#?:/' to 'screen, tv'"); 85 }, "Add '#?:/' to 'screen, tv'");
86 86
87 // - deleteMedium() 87 // - deleteMedium()
88 88
89 test(function () { 89 test(function () {
90 mediaList.mediaText = "screen, tv, not all"; 90 mediaList.mediaText = "screen, tv, not all";
91 mediaList.deleteMedium("&invalid"); 91 mediaList.deleteMedium("&invalid");
92 // Ignored; terminate steps. 92 // Ignored; terminate steps.
93 assert_equals(mediaList.mediaText, "screen, tv, not all"); 93 assert_equals(mediaList.mediaText, "screen, tv");
94 }, "Remove '&invalid' from 'screen, tv, not all'"); 94 }, "Remove '&invalid' from 'screen, tv, not all'");
95 95
96 test(function () { 96 test(function () {
97 mediaList.mediaText = "screen, tv"; 97 mediaList.mediaText = "screen, tv";
98 assert_throws("NOT_FOUND_ERR", 98 assert_throws("NOT_FOUND_ERR",
99 function () { mediaList.deleteMedium("not all"); } 99 function () { mediaList.deleteMedium("not all"); }
100 ); 100 );
101 // Not found; throw NotFoundError. 101 // Not found; throw NotFoundError.
102 }, "Remove 'not all' from 'screen, tv'"); 102 }, "Remove 'not all' from 'screen, tv'");
103 103
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 mediaList.deleteMedium("tv, print"); 146 mediaList.deleteMedium("tv, print");
147 assert_equals(mediaList.mediaText, "tv, print, screen"); 147 assert_equals(mediaList.mediaText, "tv, print, screen");
148 // CSSOM 4.1: Parsing media query returns none as 148 // CSSOM 4.1: Parsing media query returns none as
149 // there are more than one; terminate steps. 149 // there are more than one; terminate steps.
150 }, "Remove 'tv, print' from 'screen, tv, screen'"); 150 }, "Remove 'tv, print' from 'screen, tv, screen'");
151 151
152 test(function () { 152 test(function () {
153 mediaList.mediaText = "screen, tv, not all"; 153 mediaList.mediaText = "screen, tv, not all";
154 mediaList.deleteMedium("#?:/"); 154 mediaList.deleteMedium("#?:/");
155 // Ignored; terminate steps. 155 // Ignored; terminate steps.
156 assert_equals(mediaList.mediaText, "screen, tv, not all"); 156 assert_equals(mediaList.mediaText, "screen, tv");
157 }, "Remove '#?:/' from 'screen, tv, not all'"); 157 }, "Remove '#?:/' from 'screen, tv, not all'");
158 </script> 158 </script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/media/media-query-list-01-expected.txt ('k') | LayoutTests/fast/media/mq-js-media-except-01.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698