declarations-009

Ignoring at-rules inside declaration blocks

WeasyPrint

This browser

Flags
invalid
Assertion
At-rules inside declaration blocks are parsed as malformed declarations.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3  <head>
 4   <title>CSS Test: Ignoring at-rules inside declaration blocks</title>
 5   <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
 6   <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#parsing-errors">
 7   <meta name="flags" content="invalid">
 8   <meta name="assert" content="At-rules inside declaration blocks are parsed as malformed declarations.">
 9   <style type="text/css">
10     #a {
11       color: green;
12       @import "support/import-red.css" color: red;
13     }
14     #b {
15       color: red;
16       @import "support/import-red.css";
17       color: green;
18     }
19     #c {
20       color: green;
21       @media { #c { color: red !important } }
22       color: red;
23     }
24     #d {
25       color: red;
26       @media { #c { color: red !important } };
27       color: green;
28     }
29     #e {
30       color: green;
31       @foo [ color: red; } #e { color: red; } ]
32     }
33     #f {
34       color: green;
35       color: red @import "support/import-red.css";
36     }
37   </style>
38  </head>
39  <body>
40   <p id="a">This sentence must be green</p>
41   <p id="b">This sentence must be green</p>
42   <p id="c">This sentence must be green</p>
43   <p id="d">This sentence must be green</p>
44   <p id="e">This sentence must be green</p>
45   <p id="f">This sentence must be green</p>
46  </body>
47 </html>