ASSERT in editing code, ASSERTION FAILED: selection.isCaretOrRange() <body> <script> var doc = document; doc.execCommand('selectall'); doc.designMode = 'on'; doc.execCommand('insertimage', 0, '<pre>'); doc.execCommand('justifyfull', 0, 'javascript:1'); </script> ASSERTION FAILED: selection.isCaretOrRange() (/Users/eseidel/Projects/WebKit/WebCore/editing/ReplaceSelectionCommand.cpp:701 virtual void WebCore::ReplaceSelectionCommand::doApply()) Looks similar to bug 19075 which I closed as unreproducible.
Created attachment 28452 [details] test case ASSERTs in debug mode
It seems somehow the selection is set to a rootless <br> just before the ReplaceSelectionCommand is run: (gdb) p destination.m_deepPosition.container.get()->showTreeForThis() *BR 0xde5240 setEndingSelection(destination); applyCommandToComposite(ReplaceSelectionCommand::create(document(), fragment, true, false, !preserveStyle, false, true)); in CompositeEditorCommand::moveParagraphs
This could be the same root cause as https://bugs.webkit.org/show_bug.cgi?id=19066 ? This is again an empty <img> at the beginning of a document, where the editing code could be getting confused as to if the best position should be [body, 0] or [img, 0] and doing strange things as a result...