Open Bug 1363846 Opened 3 years ago Updated 2 years ago
Consider notifying the ESM on content removals after we notify the frame constructor
Right now the way content removals happen is this: 1) Remove from child list. 2) Notify observers. 3) Unbind. During step 2, we call PresShell::ContentRemoved, which calls mPresContext->EventStateManager()->ContentRemoved and mFrameConstructor->ContentRemoved in that order. Unfortunately, ESM's ContentRemoved can change element states, which will try to notify ContentStateChanged. This will see that the element still has a frame (because mFrameConstructor->ContentRemoved hasn't happened yet) and start doing various work to see whether it needs restyling. It might make sense to notify the ESM after we tear down the frame for the element, or notify it in such a way that the changes it makes don't trigger ContentStateChanged notifications.
You need to log in before you can comment on or make changes to this bug.