Created attachment 419836 [details] testcase ###!!! ASSERTION: Already have an undisplayed context entry for aContent: '!GetUndisplayedContent(aContent)', file /Users/jruderman/central/layout/base/nsFrameManager.cpp, line 398 ###!!! ASSERTION: node in map twice: 'Not Reached', file /Users/jruderman/central/layout/base/nsFrameManager.cpp, line 1736
Hmm. So the problem is that undisplayed entries are added during frame construction item creation. They're only cleared during frame destruction. In particular, if we throw away the frame construction items (e.g. due to a WipeContainingBlock) we won't remove the undisplayed entries. This is bad. Looks like a regression from bug 480979. And this happens in 1.9.2 as well. My first instinct is to flag frame construction items when frames are constructed from them, and to have the destructor clear the undisplayed map under the content if no frame has been constructed. The other option is to create items for display:none stuff and change the various code the works with item lists to ignore them (and then not construct any frames from them). That sounds annoying, though. Any other bright ideas?
So the approach from comment 1 doesn't work to fix this bug (though it does fix bug 736924), because it fails for the case when a frame construction item list is constructed for an already-existing parent and is then thrown away. In that case there is no parent frame construction item.
Created attachment 607228 [details] [diff] [review] Proposed fix
Created attachment 607263 [details] [diff] [review] Additional fix needed on top of the first patch to fix leaks The first patch leaked on try, because of that placement new clobbering our list which was holding refs to style contexts (and was also looking like an array leak, hence the new destructor call).