mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-30 01:59:29 +00:00
Bug 1061894 - Clean up correctly in ownerdiscard.html. r=seth
This commit is contained in:
parent
bbcdbef35e
commit
dd0c04a993
@ -22,9 +22,7 @@
|
||||
var img = document.getElementById('victim');
|
||||
var observer = new ImageDecoderObserverStub();
|
||||
observer.discard = function() {
|
||||
SpecialPowers.clearUserPref('min_discard_timeout_ms');
|
||||
imgLoadingContent.removeObserver(gObserver);
|
||||
setTimeout("document.documentElement.className = '';", 0);
|
||||
cleanupAndFinish();
|
||||
}
|
||||
observer = SpecialPowers.wrapCallbackObject(observer);
|
||||
var gObserver = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools)
|
||||
@ -39,10 +37,16 @@
|
||||
setTimeout(function() { document.adoptNode(tCF0); }, 0);
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", initCF, false);
|
||||
function finish() {
|
||||
setTimeout("document.documentElement.className = '';", 30000);
|
||||
|
||||
function cleanupAndFinish() {
|
||||
SpecialPowers.clearUserPref('min_discard_timeout_ms');
|
||||
imgLoadingContent.removeObserver(gObserver);
|
||||
setTimeout("document.documentElement.className = '';", 0);
|
||||
}
|
||||
window.addEventListener("load", finish, false);
|
||||
function loadhandler() {
|
||||
setTimeout("cleanupAndFinish();", 30000);
|
||||
}
|
||||
window.addEventListener("load", loadhandler, false);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user