diff options
author | Ben Murdoch <benm@google.com> | 2010-07-08 16:59:07 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-07-09 15:43:53 +0100 |
commit | 5f90462bbf4efb0ac7bb65a852d5559d0ab30f0b (patch) | |
tree | 2b300793b3246d2e70cbca389b56a360f02fa49b /LayoutTests/fast/xpath/name-null-namespace.html | |
parent | ed49531d2d6aa65c37a129aee55887dff1cf188b (diff) | |
download | external_webkit-5f90462bbf4efb0ac7bb65a852d5559d0ab30f0b.zip external_webkit-5f90462bbf4efb0ac7bb65a852d5559d0ab30f0b.tar.gz external_webkit-5f90462bbf4efb0ac7bb65a852d5559d0ab30f0b.tar.bz2 |
Add fast/xpath tests to the tree at the current webkit revision 62496. They all pass.
Note the addition of the android-v8 specific result for fast/xpath/nsresolver-exception.html
(this is added due to a V8 exception printing difference).
Change-Id: I685cb62a438b742cba3f7496b2e1bdad9a7d8d82
Diffstat (limited to 'LayoutTests/fast/xpath/name-null-namespace.html')
-rw-r--r-- | LayoutTests/fast/xpath/name-null-namespace.html | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/LayoutTests/fast/xpath/name-null-namespace.html b/LayoutTests/fast/xpath/name-null-namespace.html new file mode 100644 index 0000000..562f700 --- /dev/null +++ b/LayoutTests/fast/xpath/name-null-namespace.html @@ -0,0 +1,36 @@ +<p>Test for <a href="http://bugs.webkit.org/show_bug.cgi?id=12340">bug 12340</a>: +XPath name() function doesn't work with nodes and attributes in null namespace. +</p> +<script> +if (window.layoutTestController) + layoutTestController.dumpAsText(); + +var strXML = '<doc><record/><record/><record/><record/><record foo="a-a"/></doc>'; +var doc = (new DOMParser()).parseFromString(strXML, "text/xml"); + +// This matches in both Firefox and WebKit, which indicates that +// XPathEvaluator does not normalize the document. +doc.firstChild.childNodes[0].setAttributeNS("bar", "foo", "-a-"); + +// This doesn't match. +doc.firstChild.childNodes[1].setAttributeNS("bar", "b:foo", "-a-"); + +// These both match, too. +doc.firstChild.childNodes[2].setAttributeNS("", "foo", "-a-"); +doc.firstChild.childNodes[3].setAttributeNS(null, "foo", "-a-"); + +// The last (static) record matches, of course. + + +var xpe = new XPathEvaluator(); +var objResult = xpe.evaluate("//@*[name()='foo']", doc, null, 0, null); +var itm = null; +var objNodes = []; +while (itm = objResult.iterateNext()) + objNodes.push(itm); + +if (objNodes.length == 4) + document.write("SUCCESS"); +else + document.write("FAILURE: matched " + objNodes.length + " nodes."); +</script> |