1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
7 var logDiv
= document
.getElementById("log");
8 logDiv
.appendChild(document
.createTextNode(s
));
9 logDiv
.appendChild(document
.createElement('br'));
12 function matches(node
, clonedNode
, passedMessage
)
14 if (node
.localName
=== clonedNode
.localName
&& node
.prefix
=== clonedNode
.prefix
&& node
.namespaceURI
=== clonedNode
.namespaceURI
&& node
.nodeName
=== clonedNode
.nodeName
)
15 log("PASSED: " + passedMessage
);
22 if (window
.testRunner
)
23 testRunner
.dumpAsText();
25 var xmlDoc
= document
.implementation
.createDocument("http://www.example.com", "foo:bar", null);
27 var xmlNode
= xmlDoc
.createElement("foo:bar");
28 var clonedXMLNode
= xmlNode
.cloneNode(false); // WebKit crashes.
29 var htmlNode
= document
.getElementById('log');
30 var clonedHTMLNode
= htmlNode
.cloneNode(false);
32 matches(xmlNode
, clonedXMLNode
, "Cloned XML node matches the original");
33 matches(htmlNode
, clonedHTMLNode
, "Cloned HTML node matches the original");
37 <body onload=
"test()">
38 <p> Test for bug Bug
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=23956">23956</a>: Safari crashes when cloneNode fails (cloning a XML element with an invalid nodeName)
</p>
39 <p> For this test to pass, it should not crash and you should see PASSED twice.
</p>