summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/xpath/id-simple.html
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/xpath/id-simple.html')
-rw-r--r--LayoutTests/fast/xpath/id-simple.html43
1 files changed, 43 insertions, 0 deletions
diff --git a/LayoutTests/fast/xpath/id-simple.html b/LayoutTests/fast/xpath/id-simple.html
new file mode 100644
index 0000000..743c683
--- /dev/null
+++ b/LayoutTests/fast/xpath/id-simple.html
@@ -0,0 +1,43 @@
+<html>
+<head>
+<script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var results = "";
+ var result;
+ var testNum = 1;
+ function init() {
+ var tests = [
+ "id('nested1')",
+ "id('nested1')/div[1]",
+ "id('nested1')//div[1]",
+ "id('nested1')/div[1]/input[2]",
+ "id('nested1')/div[1]//input[2]",
+ "id('nested1')//div[1]/input[2]",
+ "id('nested1')//div[1]//input[2]"
+ ];
+ for (var i = 0; i < tests.length; i++) {
+ runXPath(tests[i]);
+ }
+ document.getElementById('results').innerHTML = results;
+ }
+
+ function runXPath(xpath) {
+ var result = document.evaluate(xpath, document, null, XPathResult.ANY_TYPE, null).iterateNext();
+ results += xpath + " " + (result ? "PASSED" : "FAILED") + ": " + result + "<br />";
+ }
+</script>
+</head>
+<body onload="init()">
+<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=15380">bug 15380</a>:
+XPath: id('foo') doesn't resolve correctly.</p>
+<div id="nested1">
+ <div id="nested2">
+ <input id="nested3a" type="button" value="nested3a">
+ <input id="nested3b" type="button" value="nested3b">
+ </div>
+ </div>
+ <div id="results"></div>
+</body>
+</html>