matching-brackets-003

Matching brackets and quotes for selectors

WeasyPrint

This browser

Flags
invalid
Assertion
User agents must handle unexpected tokens encountered while parsing a declaration by reading until the end of the statement, while observing the rules for matching pairs of brackets and quotes, and correctly handling escapes.

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: Matching brackets and quotes for selectors</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   <link rel="help" href="http://www.w3.org/TR/CSS21/media.html#at-media-rule">
 8   <meta name="flags" content="invalid">
 9   <meta name="assert" content="User agents must handle unexpected tokens     encountered while parsing a declaration by reading until the end of the     statement, while observing the rules for matching pairs of brackets     and quotes, and correctly handling escapes. ">
10  <!-- simple -->
11  <style type="text/css">
12   p { color: green; }
13   p ( { border: solid red; } p { background: red; } )
14   p { color: red; }
15  </style>
16   <!-- complex -->
17   <style type="text/css">
18     div {
19       background: red;
20       color: green;
21     }
22     ] ) test-token \
23        ~ ` ! @ # $ % ^ & * - _ + = | : > < ? / , .
24        [\]\5D ']' "]"; background: red; } div { color: red; } ]
25        (\)\29 ')' ")"; background: red; } div { color: red; } )
26        '\'; background: red; } div { color: red; }',
27        "\"; background: red; } div { color: red; }' div { color: red; } "
28     div { color: red; }
29     div { background: white; }
30   </style>
31  </head>
32  <body>
33   <p>This sentence must be green.</p>
34   <div>This sentence must be green.</div>
35  </body>
36 </html>