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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/reftests/css-parsing/invalid-url-handling.xhtml	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,117 @@
     1.4 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
     1.5 +<html xmlns="http://www.w3.org/1999/xhtml">
     1.6 + <head>
     1.7 +  <title>CSS Test: handling of invalid url() functions</title>
     1.8 +  <link rel="author" title="L. David Baron" href="http://dbaron.org/" />
     1.9 +  <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
    1.10 +  <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#tokenization" />
    1.11 +  <link rel="help" href="http://www.w3.org/TR/CSS21/syndata.html#parsing-errors" />
    1.12 +  <meta name="flags" content="invalid" />
    1.13 +  <style type="text/css">
    1.14 +  div { background-color: red }
    1.15 +  </style>
    1.16 +  <style type="text/css">
    1.17 +  /* not a URI token, but handled according to rules for parsing errors */
    1.18 +  #one { background: url(foo"bar") }
    1.19 +  #one { background-color: green; }
    1.20 +  </style>
    1.21 +  <style type="text/css">
    1.22 +  /* not a URI token, but handled according to rules for parsing errors */
    1.23 +  #foo { background: url(foo"bar
    1.24 +  ) }
    1.25 +  #two { background-color: green; }
    1.26 +  </style>
    1.27 +  <style type="text/css">
    1.28 +  /* not a URI token; the unterminated string ends at end of line, so
    1.29 +     the brace never matches */
    1.30 +  #three { background-color: green; }
    1.31 +  #foo { background: url(foo"bar) }
    1.32 +  #three { background-color: red; }
    1.33 +  </style>
    1.34 +  <style type="text/css">
    1.35 +  /* not a URI token; the unterminated string ends at end of line */
    1.36 +  #foo { background: url(foo"bar) }
    1.37 +  ) }
    1.38 +  #four { background-color: green; }
    1.39 +  </style>
    1.40 +  <style type="text/css">
    1.41 +  /* not a URI token; the unterminated string ends at end of line, so
    1.42 +     the brace never matches */
    1.43 +  #five { background-color: green; }
    1.44 +  #foo { background: url("bar) }
    1.45 +  #five { background-color: red; }
    1.46 +  </style>
    1.47 +  <style type="text/css">
    1.48 +  /* not a URI token; the unterminated string ends at end of line */
    1.49 +  #foo { background: url("bar) }
    1.50 +  ) }
    1.51 +  #six { background-color: green; }
    1.52 +  </style>
    1.53 +  <style type="text/css">
    1.54 +  /* not a URI token, but brace matching should work */
    1.55 +  #seven { background: url(()); background-color: green; }
    1.56 +  </style>
    1.57 +  <style type="text/css">
    1.58 +  /* not a URI token, but brace matching should work */
    1.59 +  #eight { background: url([{}]); background-color: green; }
    1.60 +  </style>
    1.61 +  <style type="text/css">
    1.62 +  /* not a URI token, but brace matching should work */
    1.63 +  #nine { background: url([)]); background-color: green; }
    1.64 +  </style>
    1.65 +  <style type="text/css">
    1.66 +  /* perfectly good URI token (image is a 404, though) */
    1.67 +  #ten { background: url({) green; }
    1.68 +  </style>
    1.69 +  <style type="text/css">
    1.70 +  /* perfectly good URI token (image is a 404, though) */
    1.71 +  #eleven { background: url([) green; }
    1.72 +  </style>
    1.73 +  <style type="text/css">
    1.74 +  /* not a URI token; brace matching should work only after invalid URI token */
    1.75 +  #twelve { background: url(}{""{)}); background-color: green; }
    1.76 +  </style>
    1.77 +  <style type="text/css">
    1.78 +  /* invalid URI token absorbs the [ */
    1.79 +  #thirteen { background: url([""); background-color: green; }
    1.80 +  </style>
    1.81 +  <style type="text/css">
    1.82 +  /* not a URI token; the opening ( is never matched */
    1.83 +  #fourteen { background-color: green; }
    1.84 +  #foo { background: url(() }
    1.85 +  #fourteen { background-color: red; }
    1.86 +  </style>
    1.87 +  <!-- The next three tests test that invalid URI tokens absorb [ and { -->
    1.88 +  <style type="text/css">
    1.89 +  #foo { background: url(a()); }
    1.90 +  #fifteen { background-color: green }
    1.91 +  </style>
    1.92 +  <style type="text/css">
    1.93 +  #foo { background: url([()); }
    1.94 +  #sixteen { background-color: green }
    1.95 +  </style>
    1.96 +  <style type="text/css">
    1.97 +  #foo { background: url({()); }
    1.98 +  #seventeen { background-color: green }
    1.99 +  </style>
   1.100 + </head>
   1.101 + <body>
   1.102 +  <div id="one">This should have a green background</div>
   1.103 +  <div id="two">This should have a green background</div>
   1.104 +  <div id="three">This should have a green background</div>
   1.105 +  <div id="four">This should have a green background</div>
   1.106 +  <div id="five">This should have a green background</div>
   1.107 +  <div id="six">This should have a green background</div>
   1.108 +  <div id="seven">This should have a green background</div>
   1.109 +  <div id="eight">This should have a green background</div>
   1.110 +  <div id="nine">This should have a green background</div>
   1.111 +  <div id="ten">This should have a green background</div>
   1.112 +  <div id="eleven">This should have a green background</div>
   1.113 +  <div id="twelve">This should have a green background</div>
   1.114 +  <div id="thirteen">This should have a green background</div>
   1.115 +  <div id="fourteen">This should have a green background</div>
   1.116 +  <div id="fifteen">This should have a green background</div>
   1.117 +  <div id="sixteen">This should have a green background</div>
   1.118 +  <div id="seventeen">This should have a green background</div>
   1.119 + </body>
   1.120 +</html>

mercurial