Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / uri-token-parsing.html
blob16397fd19464554e542a882d60ebaae16edc8ef5
1 <head>
2 <style>
3 #a { content: url(c); }
4 #b { content: url( d); }
5 #c { content: url(e ); }
6 #d { content: url( f ); }
7 #f { content: url('c'); }
8 #g { content: url(' d'); }
9 #h { content: url('e '); }
10 #i { content: url(' f '); }
11 #j { content: url("url(g)"); }
12 #l { content: url("c"); }
13 #m { content: url(" d"); }
14 #n { content: url("e "); }
15 #o { content: url(" f "); }
16 #p { content: url("url(g)"); }
17 #q { cursor: url("url(q)"), pointer; }
18 #r { list-style-image: url("url(r)"); }
19 #s { background-image: url("url(s)"); }
20 #t { -webkit-mask-image: url("url(t)"); }
21 #u { -webkit-border-image: url("url(u)") 1 2 3 4 fill stretch round; }
22 #v { -webkit-mask-box-image-source: url("url(v)"); }
23 #w { content: url("w\0d\
24 w"); /* URL string contains twice newline */ }
25 #x { content: url(" x x x "); } /* URL string contains space and tab */
26 #y { content: url( y\20y\9y ); } /* URL string contains space and tab */
27 </style>
29 <script>
31 // Some ideas for additional things to test in the future:
32 // 1) Actual control characters in the <style> element.
33 // 2) URL with only space characters in it.
34 // 3) Different CSS space characters, and spaces that are not allowed in CSS.
35 // 4) Different CSS space characters, and spaces that are not allowed in CSS.
36 // 5) The src property inside font-face.
37 // 6) Quoted values that are themselves inside quotes (two levels of quotes).
39 function runTest()
41 if (window.testRunner)
42 testRunner.dumpAsText();
44 var rules = document.styleSheets[0].cssRules;
45 var text = "";
46 for (var i = 0; i < rules.length; i++) {
47 var itemText = rules.item(i).cssText;
49 // Work around bug where WebKit completes the URLs in the CSS DOM.
50 // The completion of the URL should be when they are used, not in the DOM.
51 itemText = itemText.replace(/file:.*LayoutTests\/fast\/css\//, "");
53 text += itemText;
54 text += "\n";
57 document.getElementById("result").appendChild(document.createTextNode(text));
59 if (document.getElementById("result").firstChild.data === document.getElementById("expected").firstChild.data)
60 document.getElementById("message").firstChild.data = "SUCCESS";
61 else
62 document.getElementById("message").firstChild.data = "FAILURE";
65 </script>
67 </head>
69 <body onload="runTest()">
71 <p>Test parsing of CSS URI tokens. Older versions of WebKit did some double processing of these, hence this test would have failed.</p>
73 <p id="message">TEST DID NOT COMPLETE</p>
75 <p>Rules from the stylesheet:</p>
77 <pre id="result"></pre>
79 <p>Expected result:</p>
81 <pre id="expected">
82 #a { content: url(c); }
83 #b { content: url(d); }
84 #c { content: url(e); }
85 #d { content: url(f); }
86 #f { content: url(c); }
87 #g { content: url(' d'); }
88 #h { content: url('e '); }
89 #i { content: url(' f '); }
90 #j { content: url('url(g)'); }
91 #l { content: url(c); }
92 #m { content: url(' d'); }
93 #n { content: url('e '); }
94 #o { content: url(' f '); }
95 #p { content: url('url(g)'); }
96 #q { cursor: url('url(q)'), pointer; }
97 #r { list-style-image: url('url(r)'); }
98 #s { background-image: url('url(s)'); }
99 #t { -webkit-mask-image: url('url(t)'); }
100 #u { -webkit-border-image: url('url(u)') 1 2 3 4 fill stretch round; }
101 #v { -webkit-mask-box-image-source: url('url(v)'); }
102 #w { content: url('w\\d w'); }
103 #x { content: url(' x x\\9 x '); }
104 #y { content: url('y y\\9 y'); }
105 </pre>
107 <script>
109 </script>
110 </body>