at-rule-013.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <!--
  3. from the CSS 2.1 test suite,
  4. http://test.csswg.org/suites/css2.1/20110111/html4/at-rule-013.htm
  5. See ../css3-namespace/LICENSE .
  6. -->
  7. <html>
  8. <head>
  9. <title>CSS Test: Ignoring at-rules inside @media blocks</title>
  10. <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
  11. <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#parsing-errors">
  12. <link rel="help" href="http://www.w3.org/TR/CSS21/media.html#at-media-rule">
  13. <meta name="flags" content="invalid">
  14. <meta name="assert" content="At-rules inside @media blocks are ignored up to up to the end of the block that contains the invalid at-keyword, or up to and including the next semicolon (;) or up to and including the next block ({...}), whichever comes first.">
  15. <style type="text/css">
  16. p {
  17. color: red;
  18. background: red;
  19. }
  20. @media all {
  21. #semicolon { background: transparent; }
  22. @foo ] & | # $ % test-token \
  23. [; # { background: red; } ]
  24. (; #semicolon { background: red; } } } } )
  25. '; #semicolon { background: red; } } } }',
  26. "; #semicolon { background: red; }' } } }"
  27. ;
  28. #semicolon { color: green; }
  29. }
  30. @media all {
  31. #block { background: transparent; }
  32. @foo ] & | # $ % test-token \
  33. [; #block { background: red; } ]
  34. (; #block { background: red; } )
  35. '; #block { background: red; }',
  36. "; #block { background: red; }'"
  37. {; #block { background: red; }
  38. #block { background: red; } }
  39. #block { color: green; }
  40. }
  41. @media all {
  42. #eob { background: transparent; }
  43. @import "support/import-red.css"
  44. }
  45. #eob {
  46. color: green;
  47. }
  48. @media all {
  49. #eob-complex { background: transparent; }
  50. @import "support/import-red.css"
  51. [; #eob-complex { background: red; } ]
  52. (; #eob-complex { background: red; } )
  53. '; #eob-complex { background: red; }',
  54. "; #eob-complex { background: red; }'"
  55. }
  56. #eob-complex {
  57. color: green;
  58. }
  59. </style>
  60. </head>
  61. <body>
  62. <p id="semicolon">This sentence must be green.</p>
  63. <p id="block">This sentence must be green.</p>
  64. <p id="eob">This sentence must be green.</p>
  65. <p id="eob-complex">This sentence must be green.</p>
  66. </body>
  67. </html>