function soon(f) {
return function() { setTimeout(f, 0); }
}
function startTest(frameid) {
is(childUnloaded, false, "Child not unloaded yet");
var doc = $(frameid).contentDocument; var win = $(frameid).contentWindow;
ok(doc instanceof win.Document, "doc should be a document");
for (var i = 0; i < nodes.length; ++i) { var id = nodes[i][0]; var node = doc.getElementById(id);
ok(node instanceof win[nodes[i][1].name], id + " should be a " + nodes[i][1]);
is(node.disabled, false, "check for " + id + " state");
node.disabled = true;
is(node.disabled, true, "check for " + id + " state change");
}
// Do this off a timeout so it's not treated like a replace load.
function loadBlank() {
$(frameid).contentWindow.location = "about:blank";
}
setTimeout(loadBlank, 0);
}
function continueTest(frameid) {
is(childUnloaded, true, "Unload handler should have fired"); var doc = $(frameid).contentDocument; var win = $(frameid).contentWindow;
ok(doc instanceof win.Document, "doc should be a document");
for (var i = 0; i < nodes.length; ++i) { var id = nodes[i][0]; var node = doc.getElementById(id);
ok(node === null, id + " should be null");
}
// Do this off a timeout too. Why, I'm not sure. Something in session
// history creates another history state if we don't. :(
function goBack() {
$(frameid).contentWindow.history.back();
}
setTimeout(goBack, 0);
}
// XXXbz this is a nasty hack to work around the XML content sink not being
// incremental, so that the _first_ control we test is ok but others are not. var testIs = is; var once = false;
function flipper(a, b, c) {
if (once) {
todo(a == b, c);
} else {
once = true;
is(a, b, c);
}
}
function finishTest(frameid) { var doc = $(frameid).contentDocument; var win = $(frameid).contentWindow;
ok(doc instanceof win.Document, "doc should be a document");
for (var i = 0; i < nodes.length; ++i) { var id = nodes[i][0]; var node = doc.getElementById(id);
ok(node instanceof win[nodes[i][1].name], id + " should be a " + nodes[i][1]);
//testIs(node.disabled, true, "check for " + id + " state restore");
}
<!-- Don't use display:none, since we don't support framestate restoration
without a frame tree -->
<div id="content"style="visibility: hidden">
<iframe src="bug277724_iframe1.html" id="frame1"
onload="setTimeout(function() { startTest('frame1') }, 0)"></iframe>
<iframe src="" id="frame2"></iframe>
</div>
</body>
</html>
Messung V0.5
¤ Dauer der Verarbeitung: 0.31 Sekunden
(vorverarbeitet)
¤
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.