When you make changes to the DOM, these are put into the event queue and executed accordingly. However, as far as I know, the actual redraw event that this DOM modification triggers happens dynamically and is then put last in the existing queue, whatever that may already contain.
Is there a way to explicitly request the browser to do a redraw, putting it in the event queue in the same orderly fashion as all the other statements?
This is not a XY question, I know that I can use setTimeout
to leave the queue temporarily empty in order to let the redraw be executed first. And since that is a common strategy, I realize that the answer to my question probably is no, but I'd rather not jump to conclusions.