layout/reftests/css-parsing/invalid-url-handling.xhtml

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
michael@0 2 <html xmlns="http://www.w3.org/1999/xhtml">
michael@0 3 <head>
michael@0 4 <title>CSS Test: handling of invalid url() functions</title>
michael@0 5 <link rel="author" title="L. David Baron" href="http://dbaron.org/" />
michael@0 6 <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
michael@0 7 <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#tokenization" />
michael@0 8 <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#parsing-errors" />
michael@0 9 <meta name="flags" content="invalid" />
michael@0 10 <style type="text/css">
michael@0 11 div { background-color: red }
michael@0 12 </style>
michael@0 13 <style type="text/css">
michael@0 14 /* not a URI token, but handled according to rules for parsing errors */
michael@0 15 #one { background: url(foo"bar") }
michael@0 16 #one { background-color: green; }
michael@0 17 </style>
michael@0 18 <style type="text/css">
michael@0 19 /* not a URI token, but handled according to rules for parsing errors */
michael@0 20 #foo { background: url(foo"bar
michael@0 21 ) }
michael@0 22 #two { background-color: green; }
michael@0 23 </style>
michael@0 24 <style type="text/css">
michael@0 25 /* not a URI token; the unterminated string ends at end of line, so
michael@0 26 the brace never matches */
michael@0 27 #three { background-color: green; }
michael@0 28 #foo { background: url(foo"bar) }
michael@0 29 #three { background-color: red; }
michael@0 30 </style>
michael@0 31 <style type="text/css">
michael@0 32 /* not a URI token; the unterminated string ends at end of line */
michael@0 33 #foo { background: url(foo"bar) }
michael@0 34 ) }
michael@0 35 #four { background-color: green; }
michael@0 36 </style>
michael@0 37 <style type="text/css">
michael@0 38 /* not a URI token; the unterminated string ends at end of line, so
michael@0 39 the brace never matches */
michael@0 40 #five { background-color: green; }
michael@0 41 #foo { background: url("bar) }
michael@0 42 #five { background-color: red; }
michael@0 43 </style>
michael@0 44 <style type="text/css">
michael@0 45 /* not a URI token; the unterminated string ends at end of line */
michael@0 46 #foo { background: url("bar) }
michael@0 47 ) }
michael@0 48 #six { background-color: green; }
michael@0 49 </style>
michael@0 50 <style type="text/css">
michael@0 51 /* not a URI token, but brace matching should work */
michael@0 52 #seven { background: url(()); background-color: green; }
michael@0 53 </style>
michael@0 54 <style type="text/css">
michael@0 55 /* not a URI token, but brace matching should work */
michael@0 56 #eight { background: url([{}]); background-color: green; }
michael@0 57 </style>
michael@0 58 <style type="text/css">
michael@0 59 /* not a URI token, but brace matching should work */
michael@0 60 #nine { background: url([)]); background-color: green; }
michael@0 61 </style>
michael@0 62 <style type="text/css">
michael@0 63 /* perfectly good URI token (image is a 404, though) */
michael@0 64 #ten { background: url({) green; }
michael@0 65 </style>
michael@0 66 <style type="text/css">
michael@0 67 /* perfectly good URI token (image is a 404, though) */
michael@0 68 #eleven { background: url([) green; }
michael@0 69 </style>
michael@0 70 <style type="text/css">
michael@0 71 /* not a URI token; brace matching should work only after invalid URI token */
michael@0 72 #twelve { background: url(}{""{)}); background-color: green; }
michael@0 73 </style>
michael@0 74 <style type="text/css">
michael@0 75 /* invalid URI token absorbs the [ */
michael@0 76 #thirteen { background: url([""); background-color: green; }
michael@0 77 </style>
michael@0 78 <style type="text/css">
michael@0 79 /* not a URI token; the opening ( is never matched */
michael@0 80 #fourteen { background-color: green; }
michael@0 81 #foo { background: url(() }
michael@0 82 #fourteen { background-color: red; }
michael@0 83 </style>
michael@0 84 <!-- The next three tests test that invalid URI tokens absorb [ and { -->
michael@0 85 <style type="text/css">
michael@0 86 #foo { background: url(a()); }
michael@0 87 #fifteen { background-color: green }
michael@0 88 </style>
michael@0 89 <style type="text/css">
michael@0 90 #foo { background: url([()); }
michael@0 91 #sixteen { background-color: green }
michael@0 92 </style>
michael@0 93 <style type="text/css">
michael@0 94 #foo { background: url({()); }
michael@0 95 #seventeen { background-color: green }
michael@0 96 </style>
michael@0 97 </head>
michael@0 98 <body>
michael@0 99 <div id="one">This should have a green background</div>
michael@0 100 <div id="two">This should have a green background</div>
michael@0 101 <div id="three">This should have a green background</div>
michael@0 102 <div id="four">This should have a green background</div>
michael@0 103 <div id="five">This should have a green background</div>
michael@0 104 <div id="six">This should have a green background</div>
michael@0 105 <div id="seven">This should have a green background</div>
michael@0 106 <div id="eight">This should have a green background</div>
michael@0 107 <div id="nine">This should have a green background</div>
michael@0 108 <div id="ten">This should have a green background</div>
michael@0 109 <div id="eleven">This should have a green background</div>
michael@0 110 <div id="twelve">This should have a green background</div>
michael@0 111 <div id="thirteen">This should have a green background</div>
michael@0 112 <div id="fourteen">This should have a green background</div>
michael@0 113 <div id="fifteen">This should have a green background</div>
michael@0 114 <div id="sixteen">This should have a green background</div>
michael@0 115 <div id="seventeen">This should have a green background</div>
michael@0 116 </body>
michael@0 117 </html>

mercurial