I'm altering the DOM tree in plain JS and need to know when the changes get fully rendered on screen (mostly care about document dimensions).
window.onload=function(){
ss = document.styleSheets[0];
for(i = 0; i < ss.cssRules.length; i++) { ss.deleteRule(i) };
ss.addRule('p', 'color: red;')
// ... many more
// call some other function when the page is fully rendered?
}
TIA.