Created attachment 349844 [details] [diff] [review] possible patch Because of EventStateManager, quite many frames are marked to have external reference (i.e. have one or more weak frames). We could detect the case when there are no weak frames and remove the bit. That would speed up nsIFrame::Destroy a bit, but it would slow down using weak frames. Note, pretty much always when removing a weak frame we have only 2 weak frames in the presshell (ESM has few nsWeakFrame members) - the one we're removing and some other. Anyway the while-loops here should be fast.