Bug 587931: Don't fire error if a <script> is canceled. r=mrbkap a=jst

This commit is contained in:
Jonas Sicking 2010-09-17 16:08:03 -07:00
parent 2bc97b9948
commit 9370c6ecf8
2 changed files with 12 additions and 6 deletions

View File

@ -724,9 +724,6 @@ nsScriptLoader::ProcessRequest(nsScriptLoadRequest* aRequest)
NS_LITERAL_STRING("afterscriptexecute"),
PR_TRUE, PR_FALSE);
}
else {
rv = NS_ERROR_ABORT;
}
FireScriptEvaluated(rv, aRequest);

View File

@ -64,13 +64,22 @@ document.body.appendChild(s);
<!-- Test cancel using beforescriptexecute -->
<script onbeforescriptexecute="return false;"
onafterescriptexecute="window.firedAfterScriptExecuteForCancel = true;"
onload="window.firedLoadForCancel = true;">
onafterescriptexecute="window.firedAfterScriptExecuteForCancel = true;">
ok(false, "should have been canceled");
</script>
<script>
isnot(window.firedAfterScriptExecuteForCancel, true, "onafterscriptexecute executed");
isnot(window.firedLoadForCancel, true, "onload executed");
</script>
<!-- Test cancel using beforescriptexecute for external -->
<script onbeforescriptexecute="return false;"
onafterescriptexecute="window.extFiredAfterScriptExecuteForCancel = true;"
onload="window.extFiredLoadForCancel = true;"
src="data:text/plain,ok(false, 'should have been canceled');">
</script>
<script>
isnot(window.extFiredAfterScriptExecuteForCancel, true, "onafterscriptexecute executed");
is(extFiredLoadForCancel, true, "onload executed");
</script>
<!-- Test that all events fire -->