blob: 5616fb047b615c9178707de8690b58a18e551d63 [file] [log] [blame]
* Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
* for details. All rights reserved. Use of this source code is governed by a
* BSD-style license that can be found in the LICENSE file.
* @description
import "dart:html";
import "../../testcommon.dart";
main() {
<p> Test for bug Bug <a href="">23956</a>: Safari crashes when clone fails (cloning a XML element with an invalid nodeName)</p>
<p> For this test to pass, it should not crash and you should see PASS twice.</p>
<div id='log'/>
''', treeSanitizer: new NullTreeSanitizer());
var logDiv = document.getElementById("log");
logDiv.append(new Text(s));
matches(node, clonedNode, passedMessage)
if (node.localName == clonedNode.localName
//&& node.prefix == clonedNode.prefix
&& node.namespaceUri == clonedNode.namespaceUri
&& node.nodeName == clonedNode.nodeName)
log("PASS: " + passedMessage);
var xmlDoc = document.implementation
.createDocument("", "foo:bar", null);
var xmlNode = xmlDoc.createElement("foo:bar");
var clonedXMLNode = xmlNode.clone(false); // WebKit crashes.
var htmlNode = document.getElementById('log');
var clonedHTMLNode = htmlNode.clone(false);
matches(xmlNode, clonedXMLNode, "Cloned XML node matches the original");
matches(htmlNode, clonedHTMLNode, "Cloned HTML node matches the original");