matching-brackets-003.xht (1654B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <title>CSS Test: Matching brackets and quotes for selectors</title> 6 <link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact"/> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#parsing-errors"/> 8 <link rel="help" href="http://www.w3.org/TR/CSS21/media.html#at-media-rule"/> 9 <link rel="match" href="matching-brackets-001-ref.xht"/> 10 <meta name="flags" content="invalid"/> 11 <meta name="assert" content="User agents must handle unexpected tokens 12 encountered while parsing a declaration by reading until the end of the 13 statement, while observing the rules for matching pairs of brackets 14 and quotes, and correctly handling escapes. "/> 15 <!-- simple --> 16 <style type="text/css"><![CDATA[ 17 p { color: green; } 18 p ( { border: solid red; } p { background: red; } ) 19 p { color: red; } 20 ]]></style> 21 <!-- complex --> 22 <style type="text/css"><![CDATA[ 23 div { 24 background: red; 25 color: green; 26 } 27 ] ) test-token \ 28 ~ ` ! @ # $ % ^ & * - _ + = | : > < ? / , . 29 [\]\5D ']' "]"; background: red; } div { color: red; } ] 30 (\)\29 ')' ")"; background: red; } div { color: red; } ) 31 '\'; background: red; } div { color: red; }', 32 "\"; background: red; } div { color: red; }' div { color: red; } " 33 div { color: red; } 34 div { background: white; } 35 ]]></style> 36 </head> 37 <body> 38 <p>This sentence must be green.</p> 39 <div>This sentence must be green.</div> 40 </body> 41 </html>