case 1:
I load a very large HTML page that includes a lot of complex layout and fonts. The page will take some unknown time to render.
case 2:
I use jquery .html() function to make significant changes to my DOM. The modified DOM will take some unknown time to render.
In both cases, I want to be able to cover the whole screen with a spinner until the page has completely finished rendering.
In searching for answers to this question, I have found similar questions asked but the answers are not relevant. To be clear:
I don't want to know when the DOM is ready.
I don't want to know when the HTTP data has been fetched.
I want to know when everything in the DOM has been completely drawn to the screen.
Setting some worst-case timeout is not an acceptable solution.
I need a solution for WebKit based browsers.