fune/testing/web-platform/tests/html/semantics/scripting-1/the-script-element/script-onload-insertion-point.html
Boris Zbarsky 363a5143aa Bug 1297125. Make sure the parser insertion point is defined when firing the load event for external <scripts> or firing the error event on a failed external script load (but not other cases, like bogus script URL). r=hsivonen
If we have a creator parser, then we were a parser-inserted script and should
presumably be able to set a valid insertion point when we run or fire our
load/error events.  For the error event case, we do this in
nsScriptElement::ScriptAvailable, so that async error events due to things like
bogus script URLs do not end up with a valid insertion point.  For the load
event case, we just do this in ScriptEvaluated directly.

ScriptEvaluated is called while the scriptloader has our script set as the
current parser-inserted script.  But for the error event case we need to
maintain that state around the ScriptAvailable call that will fire the event.
2016-09-02 17:55:38 -04:00

12 lines
457 B
HTML

<!doctype html>
<meta charset=utf-8>
<title>Test that the insertion point is defined in the load event of a parser-inserted script.</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
var t = async_test("");
var writeDone = t.step_func_done(function(text) {
assert_equals(text, "Some text");
});
</script>
<iframe src="support/script-onload-insertion-point-helper.html"></iframe>