Fix incorrect onload event.

Previously "load" event is dispatched as soon as we've finished executing all scripts parsed during the initial load.
However, it's incorrect. Currently "load" event is dispatched after finishing compositing.