Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / xpath / text-nodes.html
blob8a50eb75661a6ab7fa8ae398cbdbf5965dcd5d02
1 <body>
2 <script>
3 if (window.testRunner)
4 testRunner.dumpAsText();
6 src = '<doc><elem>a<![CDATA[b]]>c</elem></doc>';
7 doc = (new DOMParser).parseFromString(src, "application/xml");
9 elem = doc.documentElement.firstChild;
10 aText = elem.firstChild;
11 bText = elem.firstChild.nextSibling;
12 cText = elem.lastChild;
14 function test(expr, context) {
15 nodeset = doc.evaluate(expr, context, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
16 str = "";
17 while (currNode = nodeset.iterateNext()) {
18 if (str)
19 str += " ";
20 str += currNode.nodeValue;
23 document.write(expr + ", " + (context.nodeValue ? context.nodeValue : context) + ": \"" + str + "\"<br>");
26 document.write("<xmp>" + src + "</xmp>");
28 test("child::*", elem);
29 test("child::node()", elem);
30 test("descendant::*", elem);
31 test("descendant::node()", elem);
32 test("descendant::node()[2]", elem);
33 test("ancestor-or-self::node()", bText);
34 test("ancestor-or-self::*", bText);
35 test("ancestor-or-self::node()", aText);
36 test("ancestor-or-self::*", aText);
37 test("following::node()", elem);
38 test("following::node()", aText);
39 test("following::text()", aText);
40 test("following::node()", bText);
41 test("following-sibling::node()", elem);
42 test("following-sibling::node()", aText);
43 test("following-sibling::text()", aText);
44 test("following-sibling::node()", bText);
45 test("preceding::node()", bText);
46 test("preceding-sibling::node()", bText);
47 test("preceding::node()", cText);
48 test("preceding::text()", cText);
49 test("preceding-sibling::node()", cText);
50 test("preceding-sibling::text()", cText);
51 test("self::node()", bText);
53 </script>
54 </body>