Improved stability when the DOM changes during layout

Sadly, I didn't need any Task Scheduler for that, in the end. I wonder
what do to with all this code now…