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

Side by Side Diff: LayoutTests/fast/media/mq-js-media-except-02.html

Issue 14065029: Improved parse error handling for CSSMQ. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 7 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 <html> 1 <html>
2 <head> 2 <head>
3 <title>CSS3 media query test: @media css rule media.mediaText property parsing, media query syntax error should be handled correctly.</title> 3 <title>CSS3 media query test: @media css rule media.mediaText property parsing, media query syntax error should be handled correctly.</title>
4 <link rel="help" href="http://www.w3.org/TR/CSS21/media.html" /> 4 <link rel="help" href="http://www.w3.org/TR/CSS21/media.html" />
5 <link rel="help" href="http://www.w3.org/TR/cssom/#dom-medialist-mediatext" />
5 6
6 <style type="text/css"> 7 <style type="text/css">
7 p#result {color: green} 8 p#result {color: green}
8 9
9 @media not screen { 10 @media not screen {
10 /* query will be modified from javascript */ 11 /* query will be modified from javascript */
11 /* the manipulation contains syntax error, and should fail */ 12 /* the manipulation contains syntax error, and should fail */
12 p#result {color: red} 13 p#result {color: red}
13 } 14 }
14 15
15 @media screen and resolution > 40dpi { 16 @media screen and resolution > 40dpi {
16 /* media query with syntax error should fail */ 17 /* media query with syntax error should fail */
17 /* corresponding DOM manipulation will fail */ 18 /* corresponding DOM manipulation will fail */
18 p#result {color: red} 19 p#result {color: red}
19 } 20 }
20 </style> 21 </style>
21 <script language="javascript"> 22 <script language="javascript">
22 function test() { 23 function test() {
23 try { 24 try {
24 // this should throw 25 // this should throw
25 document.styleSheets[0].cssRules[1].media.mediaText = "screen and resolu tion > 40dpi"; 26 document.styleSheets[0].cssRules[1].media.mediaText = "screen and resolu tion > 40dpi";
27 document.getElementById("result").innerHTML = "This text should be green .";
26 } catch (e) { 28 } catch (e) {
27 document.getElementById("result").innerHTML = "This text should be green .";
28 document.getElementById("details").innerHTML = "Caught exception: " + e; 29 document.getElementById("details").innerHTML = "Caught exception: " + e;
29 } 30 }
30 } 31 }
31 </script> 32 </script>
32 33
33 </head> 34 </head>
34 <body onload="test()"> 35 <body onload="test()">
35 <p id="result">Failure: test not run</p> 36 <p id="result">Failure: test not run</p>
36 <p id="details"></p> 37 <p id="details"></p>
37 </body> 38 </body>
38 </html> 39 </html>
OLDNEW
« no previous file with comments | « LayoutTests/fast/media/mq-invalid-syntax-02-expected.html ('k') | LayoutTests/fast/media/mq-js-media-except-02-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698