summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/xpath/namespace-vs-predicate.xhtml
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/xpath/namespace-vs-predicate.xhtml')
-rw-r--r--LayoutTests/fast/xpath/namespace-vs-predicate.xhtml43
1 files changed, 43 insertions, 0 deletions
diff --git a/LayoutTests/fast/xpath/namespace-vs-predicate.xhtml b/LayoutTests/fast/xpath/namespace-vs-predicate.xhtml
new file mode 100644
index 0000000..8ef85ef
--- /dev/null
+++ b/LayoutTests/fast/xpath/namespace-vs-predicate.xhtml
@@ -0,0 +1,43 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:ev="http://www.w3.org/2001/xml-events"
+ xml:space="preserve">
+<head>
+ <title/>
+</head>
+<body>
+ <p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=12733">bug 12733</a>:
+ XPath namespace is attached to a wrong step.</p>
+ <div id="result">FAILURE: script did't run</div>
+ <svg:g id="r_00"/>
+ <script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ function nsResolver(prefix) {
+ var ns={
+ 'ev' : 'http://www.w3.org/2001/xml-events',
+ 'mathml' : 'http://www.w3.org/1998/Math/MathML',
+ 'svg' : 'http://www.w3.org/2000/svg',
+ 'xhtml' : 'http://www.w3.org/1999/xhtml',
+ 'xlink' : 'http://www.w3.org/1999/xlink'
+ };
+ return ns[prefix] || null;
+ }
+
+ var result = document.evaluate("//svg:g[@id = 'r_00']", document.documentElement, nsResolver, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+ if (result.snapshotLength == 1)
+ document.getElementById("result").firstChild.nodeValue = "SUCCESS";
+ else
+ document.getElementById("result").firstChild.nodeValue = "FAILURE: " + result.snapshotLength + " node(s) matched - should be 1";
+
+ // Remove this node from the document so it doesn't make the DumpRenderTree output
+ // different when SVG is enabled and disabled.
+ var g = document.getElementsByTagNameNS("http://www.w3.org/2000/svg", "g")[0];
+ g.parentNode.removeChild(g);
+ </script>
+
+</body>
+</html>