1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en"
3 xmlns:
svg=
"http://www.w3.org/2000/svg"
4 xmlns:
xlink=
"http://www.w3.org/1999/xlink"
5 xmlns:
ev=
"http://www.w3.org/2001/xml-events"
11 <p>Test for
<a href=
"http://bugs.webkit.org/show_bug.cgi?id=12733">bug
12733</a>:
12 XPath namespace is attached to a wrong step.
</p>
13 <div id=
"result">FAILURE: script did't run
</div>
16 if (window
.testRunner
)
17 testRunner
.dumpAsText();
19 function nsResolver(prefix
) {
21 'ev' : 'http://www.w3.org/2001/xml-events',
22 'mathml' : 'http://www.w3.org/1998/Math/MathML',
23 'svg' : 'http://www.w3.org/2000/svg',
24 'xhtml' : 'http://www.w3.org/1999/xhtml',
25 'xlink' : 'http://www.w3.org/1999/xlink'
27 return ns
[prefix
] || null;
30 var result
= document
.evaluate("//svg:g[@id = 'r_00']", document
.documentElement
, nsResolver
, XPathResult
.ORDERED_NODE_SNAPSHOT_TYPE
, null);
31 if (result
.snapshotLength
== 1)
32 document
.getElementById("result").firstChild
.nodeValue
= "SUCCESS";
34 document
.getElementById("result").firstChild
.nodeValue
= "FAILURE: " + result
.snapshotLength
+ " node(s) matched - should be 1";
36 // Remove this node from the document so it doesn't make the DumpRenderTree output
37 // different when SVG is enabled and disabled.
38 var g
= document
.getElementsByTagNameNS("http://www.w3.org/2000/svg", "g")[0];
39 g
.parentNode
.removeChild(g
);