var iframes = document.getElementsByTagName("iframe");
for (var i = 1; i < iframes.length; i++) { var doc = iframes[i].contentDocument; var clonefalse = doc.cloneNode(false);
// doc.compatMode
ok(doc.compatMode == clonefalse.compatMode, "compatMode not preserved correctly; " + iframes[i].id);
// innerHTML+tag case test var clonetrue = doc.cloneNode(true);
doc.documentElement.firstChild.innerHTML="<div><dD></dD></div>";
clonetrue.documentElement.firstChild.innerHTML="<div><dD></dD></div>";
ok(doc.documentElement.innerHTML == clonetrue.documentElement.innerHTML, "innerHTML not preserved correctly; " + iframes[i].id);
}
// A couple of tests that don't quite fit in the framework. var doc = iframes[0].contentDocument;
// Setting document.dir does nothing in a document without an <html> element
doc.dir="rtl"; var docclone = doc.cloneNode(false);
// doc.dir
ok(docclone.dir == "", "dir set on doc without html element");
// document.querySelectorAll(":lang(ja)")
docclone.appendChild(docclone.createElement("html"));
ok(docclone.querySelectorAll(":lang(ja)").length == 1, "lang not preserved correctly");
docclone.documentElement.innerHTML="<body><p><a href='a.html' id=a>asf</a></body>";
ok(docclone.getElementById('a').href == "http://www.mozilla.org/a.html", "base not preserved correctly");
// Now that we have an <html> element, deep cloning preserves document.dir
docclone.dir="rtl"; var cloneclone = docclone.cloneNode(true);
// doc.dir
ok(cloneclone.dir == "rtl", "dir not preserved correctly");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.