Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / xpath / xpath-detached-nodes.html
blob1426787df66f0db9cd5d2fa12dfcc792f142a150
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <p>This tests XPath expressions on detached document fragments and nodes.
8 <br/>See https://bugs.webkit.org/show_bug.cgi?id=36427
9 <div id="console"></div>
11 <script>
12 frag = document.createDocumentFragment();
13 child = document.createElement('div');
14 frag.appendChild(child);
15 child.appendChild(document.createElement('h2'));
16 shouldBe("document.evaluate('count(/div)', child, null, XPathResult.NUMBER_TYPE, null).numberValue",
17 "1");
18 shouldBe("document.evaluate('count(/html)', child, null, XPathResult.NUMBER_TYPE, null).numberValue",
19 "0");
20 shouldBe("document.evaluate('count(/)', child, null, XPathResult.NUMBER_TYPE, null).numberValue",
21 "1");
22 shouldBe("document.evaluate('count(//html)', child, null, XPathResult.NUMBER_TYPE, null).numberValue",
23 "0");
24 shouldBe("document.evaluate('count(//div)', child, null, XPathResult.NUMBER_TYPE, null).numberValue",
25 "1");
26 shouldBe("document.evaluate('count(//h2)', child, null, XPathResult.NUMBER_TYPE, null).numberValue",
27 "1");
29 ele = document.createElement('p');
30 ele.appendChild(document.createElement('h1'));
31 shouldBe("document.evaluate('count(/h1)', ele, null, XPathResult.NUMBER_TYPE, null).numberValue",
32 "1");
33 shouldBe("document.evaluate('count(/html)', ele, null, XPathResult.NUMBER_TYPE, null).numberValue",
34 "0");
35 shouldBe("document.evaluate('count(/)', ele, null, XPathResult.NUMBER_TYPE, null).numberValue",
36 "1");
37 shouldBe("document.evaluate('count(//html)', ele, null, XPathResult.NUMBER_TYPE, null).numberValue",
38 "0");
39 shouldBe("document.evaluate('count(//p)', ele, null, XPathResult.NUMBER_TYPE, null).numberValue",
40 "0");
41 shouldBe("document.evaluate('count(//h1)', ele, null, XPathResult.NUMBER_TYPE, null).numberValue",
42 "1");
43 shouldBe("document.evaluate('/* | *', ele, null, XPathResult.NUMBER_TYPE, null).numberValue",
44 "NaN");
45 </script>
46 </body>
47 </html>