Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / SelectorAPI / not-supported-namespace-in-selector.html
blob2a2edbb154fb09d5c944d6bbc4c8da86b6c63bb6
1 <html>
2 <head>
3 <script>
4 if (window.testRunner)
5 testRunner.dumpAsText();
7 log = function(msg)
9 document.getElementById('console').appendChild(document.createTextNode(msg + "\n"));
12 shouldThrow = function(_a)
14 try {
15 eval(_a);
16 log("FAIL: " + _a + " did not throw");
17 } catch(ex) {
18 log("PASS: " + _a + " throws: " + ex);
22 shouldNotThrow = function(_a)
24 try {
25 eval(_a);
26 log("PASS: " + _a + " did not throw");
27 } catch(ex) {
28 log("FAIL: " + _a + " throws: " + ex);
32 onload = function()
34 shouldThrow("document.querySelector('bbb|pre')");
35 shouldThrow("document.querySelectorAll('bbb|pre')");
36 shouldThrow("document.body.webkitMatchesSelector('bbb|pre')");
37 shouldNotThrow("document.querySelector('*|pre')");
38 shouldNotThrow("document.querySelectorAll('*|pre')");
39 shouldNotThrow("document.body.webkitMatchesSelector('*|pre')");
40 shouldNotThrow("document.querySelector('|pre')");
41 shouldNotThrow("document.querySelectorAll('|pre')");
42 shouldNotThrow("document.body.webkitMatchesSelector('|pre')");
44 shouldThrow("document.querySelector('div bbb|pre')");
45 shouldThrow("document.querySelectorAll('div bbb|pre')");
46 shouldThrow("document.body.webkitMatchesSelector('div bbb|pre')");
47 shouldNotThrow("document.querySelector('div *|pre')");
48 shouldNotThrow("document.querySelectorAll('div *|pre')");
49 shouldNotThrow("document.body.webkitMatchesSelector('div *|pre')");
50 shouldNotThrow("document.querySelector('div |pre')");
51 shouldNotThrow("document.querySelectorAll('div |pre')");
52 shouldNotThrow("document.body.webkitMatchesSelector('div |pre')");
54 shouldThrow("document.querySelector('[bbb|name=value]')");
55 shouldThrow("document.querySelectorAll('[bbb|name=value]')");
56 shouldThrow("document.body.webkitMatchesSelector('[bbb|name=value]')");
57 shouldNotThrow("document.querySelector('[*|name=value]')");
58 shouldNotThrow("document.querySelectorAll('[*|name=value]')");
59 shouldNotThrow("document.body.webkitMatchesSelector('[*|name=value]')");
60 shouldNotThrow("document.querySelector('[|name=value]')");
61 shouldNotThrow("document.querySelectorAll('[|name=value]')");
62 shouldNotThrow("document.body.webkitMatchesSelector('[|name=value]')");
64 shouldThrow("document.querySelector(':-webkit-any(bbb|pre)')");
66 shouldThrow("document.querySelector('div [bbb|name=value]')");
67 shouldThrow("document.querySelectorAll('div [bbb|name=value]')");
68 shouldThrow("document.body.webkitMatchesSelector('div [bbb|name=value]')");
69 shouldNotThrow("document.querySelector('div [*|name=value]')");
70 shouldNotThrow("document.querySelectorAll('div [*|name=value]')");
71 shouldNotThrow("document.body.webkitMatchesSelector('div [*|name=value]')");
72 shouldNotThrow("document.querySelector('div [|name=value]')");
73 shouldNotThrow("document.querySelectorAll('div [|name=value]')");
74 shouldNotThrow("document.body.webkitMatchesSelector('div [|name=value]')");
76 </script>
77 </head>
78 <body>
79 <p>This tests that we throw a NAMESPACE_ERR when parsing a selector string for querySelector and querySelectorAll
80 that contains a namespace.</p>
81 <pre id="console" name="value"></pre>
82 </body>
83 </html>