Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / xpath / py-dom-xpath / predicates.html
blob2fa61a5d5f19c446d69b14a7da5ffee0ac003970
1 <html>
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 <script src="../xpath-test-pre.js"></script>
5 </head>
6 <body>
7 <div id="console"></div>
9 <script>
10 var doc = (new DOMParser).parseFromString(
11 '<doc id="0">' +
12 '<item id="1" />' +
13 '<group id="g1">' +
14 '<item id="2" />' +
15 '<group id="g2">' +
16 '<item id="3" />' +
17 '</group>' +
18 '<item id="4" />' +
19 '<item id="5" />' +
20 '</group>' +
21 '<item id="6" />' +
22 '<choice index="2" />' +
23 '</doc>',
24 'application/xml');
26 var ROOT = doc.documentElement;
27 var I1 = ROOT.firstChild;
28 var G1 = I1.nextSibling;
29 var I2 = G1.firstChild;
30 var G2 = I2.nextSibling;
31 var I3 = G2.firstChild;
32 var I4 = G2.nextSibling;
33 var I5 = I4.nextSibling;
34 var I6 = G1.nextSibling;
36 test(doc, doc.documentElement, '//item[@id >= 2 and @id <= 4]', [I2, I3, I4]);
37 test(doc, doc.documentElement, '/doc/child::item[1]', [I1]);
38 test(doc, doc.documentElement, '//group[@id="g2"]/ancestor::*[1]', [G1]);
39 test(doc, doc.documentElement, '//item[@id="2"]/following-sibling::item[1]', [I4]);
40 test(doc, doc.documentElement, '//item[@id="5"]/preceding-sibling::item[1]', [I4]);
41 test(doc, doc.documentElement, '//group[@id="g2"]/following::item[1]', [I4]);
42 test(doc, doc.documentElement, '//group[@id="g2"]/preceding::item[1]', [I2]);
43 test(doc, doc.documentElement, '//group[@id="g1"]/descendant-or-self::item[1]', [I2]);
44 test(doc, doc.documentElement, '//group[@id="g2"]/ancestor-or-self::*[1]', [G2]);
45 test(doc, doc.documentElement, '//group/descendant::item[number(//choice/@index)*2]', [I5]);
46 test(doc, doc.documentElement, '(//item[@id="5"]/preceding-sibling::item)[1]', [I2]);
48 </script>
49 </body>
50 </html>