disclaimer: I'm talking from my experience, I may not be right after all
I understand you wanting to do things before onload,
and right after dom is loaded.
This however does not mean that scripts can not be on the bottom.
If you want to change the whole document before rendering
you definitely must wait for the whole html to be read by browser,
and if the page is big enough (a huge table 50x100 with loads of markup)
the rendering will start even before the whole document is read.
if you have an example of the page where it is a clear difference
when changing content before render and simply onload
I'm convinced I can make it work with scripts on the bottom.
you can definitely hide the content before rendering and without a line of js
the example is untested, but you can understand what I mean....
<div id="hideDiv" style="display:none">
<script .... js libs...>
//transform dom (all dom is loaded if the script is at bottom)
var div = document.getElementById("hideDiv");
//div.style.display = "block";
//or remove div from body and move all it's children to body
document.body.appendChild(div.firstChild);//it will be removed from div automatically
adding scripts to bottom or top definitely makes a difference,
having it as an option brings more complexity to users that are
more server side centric.
If you want to manipulate dom you can do it on the server side as well
(not as many options there though)
here is the TestSlow that does not show content before the alert
(the alert will be shown later because the images will start loading before
since they are before scripts in the source)