chromium/third_party/blink/web_tests/fast/loader/for-window-event-onload-scripts.html

<script>
if (window.testRunner)
    testRunner.dumpAsText();
</script>

<script for="body" event="onload()">
    alert("This script should NOT be run because 'for=body' and 'event=onload()' should not be run.");
</script>

<script for="window" event="onload">
    alert("This script SHOULD be run because it has both 'for=window' and 'event=onload'.");
</script>

<script for="window" event="onload()">
    alert("This script SHOULD be run because it has both 'for=window' and 'event=onload()'.");
</script>

<script for="FOO">
    alert("This script SHOULD be run because it only has a for attribute.");
</script>

<script event="BAR">
    alert("This script SHOULD be run because it only has an event attribute.");
</script>

<script for="   window   " event="onload()">
alert("This script SHOULD be run because it has both 'for=   window   ' and 'event=onload()' and the whitespace should be irrelevant.");
</script>

<script for="window" event="   onload()   ">
alert("This script SHOULD be run because it has both 'for=window' and 'event=   onload()   ' and the whitespace should be irrelevant.");
</script>

<script for="   window   " event="   onload()   ">
alert("This script SHOULD be run because it has both 'for=   window   ' and 'event=   onload()   ' and the whitespace should be irrelevant.");
</script>

<script for="   window   " event="onload">
alert("This script SHOULD be run because it has both 'for=   window   ' and 'event=onload' and the whitespace should be irrelevant.");
</script>

<script for="window" event="   onload   ">
alert("This script SHOULD be run because it has both 'for=window' and 'event=   onload   ' and the whitespace should be irrelevant.");
</script>

<script for="   window   " event="   onload   ">
alert("This script SHOULD be run because it has both 'for=   window   ' and 'event=   onload   ' and the whitespace should be irrelevant.");
</script>