Removing an element from the stack is observable so do it from a task. https://www.w3.org/Bugs/Public/show_bug.cgi?id=26379