<!DOCTYPE html>
<title>Node.cloneNode</title>
<script src="testharness.js"></script>
<div id=log></div>
<script>
test(function() {
  var el = document.createElement("foo");
  el.setAttribute("a", "b");
  el.setAttribute("c", "d");
  var c = el.cloneNode(false);
  assert_true(c.attributes != el.attributes);
  assert_true(c.attributes !== el.attributes);
  assert_true(c.attributes[0] !== el.attributes[0]);
  assert_equals(c.attributes[0].name, el.attributes[0].name);
  assert_equals(c.attributes[0].prefix, el.attributes[0].prefix);
  assert_equals(c.attributes[0].namespaceURI, el.attributes[0].namespaceURI);
  assert_equals(c.attributes[0].value, el.attributes[0].value);
})
</script>

<!DOCTYPE html>
<title>Node.cloneNode</title>
<script src="testharness.js"></script>
<div id=log></div>
<script>
test(function() {
  assert_throws("DATA_CLONE_ERR", function() { document.cloneNode(true) });
  assert_throws("DATA_CLONE_ERR", function() { document.cloneNode(false) });
  assert_throws("DATA_CLONE_ERR", function() { document.doctype.cloneNode(true) });
  assert_throws("DATA_CLONE_ERR", function() { document.doctype.cloneNode(false) });
})
test(function() {
  var el = document.createElement("foo");
  el.appendChild(document.createElement("bar"));
  el.setAttribute("a", "b");
  el.setAttribute("c", "d");
  var c = el.cloneNode(false);
  assert_true(c.attributes != el.attributes);
  assert_true(c.attributes !== el.attributes);
  assert_true(c.attributes[0] !== el.attributes[0]);
  assert_equals(c.attributes.length, el.attributes.length);
  for (var i = 0, il = el.attributes.length; i < il; ++i) {
    assert_equals(c.attributes[i].name, el.attributes[i].name);
    assert_equals(c.attributes[i].prefix, el.attributes[i].prefix);
    assert_equals(c.attributes[i].namespaceURI, el.attributes[i].namespaceURI);
    assert_equals(c.attributes[i].value, el.attributes[i].value);
  }
  assert_equals(c.childNodes.length, 0);
})
</script>

Add some tests for Node.cloneNode.
Add some tests for Node.cloneNode.
