Created attachment 441693 [details] testcase ###!!! ASSERTION: setting focus to a node from the wrong document: '!aNode || aNode->GetCurrentDoc() == mDoc', file /Users/jruderman/mozilla-central/dom/base/nsGlobalWindow.cpp, line 6931
The testcase only triggers the assertion if the browser window does *not* have focus. It reloads itself after 2 seconds to make testing easier.
Created attachment 456861 [details] slightly simpler testcase This testcase doesn't reload. What's happening here: 1. The <input type="file"> is focused with focus() 2. This causes the focus to be placed on the anonymous button inside it. 3. Setting contentEditable and flushing changes (by retrieving offsetHeight) causes the focused anonymous button to be removed from the document. Presumably, the anonymous content is regenerated. If I change the timeout, I can visibly see the focus ring disappear from the button when this happens. 4. However, the focus manager is not notified of content removal so assumes the button is still focused. I assume somewhere code needs to be added to notify the focus manager when focused anonymous content is removed. I don't know where that would be. Note that various warnings appear: WARNING: NS_ENSURE_TRUE(mDoneSetup) failed: file /builds/moz2/working/editor/composer/src/nsEditingSession.cpp, line 561 WARNING: NS_ENSURE_TRUE(mBoundFrame) failed: file /builds/moz2/working/content/html/content/src/nsTextEditorState.cpp, line 1326 WARNING: NS_ENSURE_TRUE(mBoundFrame) failed: file /builds/moz2/working/content/html/content/src/nsTextEditorState.cpp, line 1326
Created attachment 457113 [details] the right testcase
(In reply to comment #4) > WFM? Does it not trigger the assertion for you? It does for me, if the browser window is not focused, as stated in comment 1.
Oh, I missed comment 1 ;)