<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Should never be reached failure in WebCore::ReplaceSelectionCommand::mergeEndIfNeeded"
   href="https://bugs.webkit.org/show_bug.cgi?id=151108">151108</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Should never be reached failure in WebCore::ReplaceSelectionCommand::mergeEndIfNeeded
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Local Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>HTML Editing
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rhodovan.u-szeged&#64;partner.samsung.com
          </td>
        </tr>

        <tr>
          <th>Blocks</th>
          <td>116980
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=265194" name="attach_265194" title="Test">attachment 265194</a> <a href="attachment.cgi?id=265194&amp;action=edit" title="Test">[details]</a></span>
Test

Load the attached test with debug MiniBrowser:

&lt;!DOCTYPE html&gt;
&lt;script&gt;
function f_0() {
    document.designMode = 'on';
    document.execCommand(&quot;selectAll&quot;);
    document.execCommand(&quot;indent&quot;);
    document.execCommand(&quot;InsertHorizontalRule&quot;);
}
&lt;/script&gt;
&lt;style&gt;
* {
    display: inline-block;
    background-position: center bottom, center center;
}
&lt;/style&gt;
&lt;body onload='f_0()'&gt;a&lt;/body&gt;


OS: Ubuntu 15.04 x86_64
Checked build: debug EFL
Checked version: 29ae33c


Backtrace:

SHOULD NEVER BE REACHED
../../Source/WebCore/editing/ReplaceSelectionCommand.cpp(830) : void WebCore::ReplaceSelectionCommand::mergeEndIfNeeded()
1   0x7f566fcae89f WTFCrash
2   0x7f5675f6c684 WebCore::ReplaceSelectionCommand::mergeEndIfNeeded()
3   0x7f5675f6f793 WebCore::ReplaceSelectionCommand::doApply()
4   0x7f56770e1220 WebCore::CompositeEditCommand::applyCommandToComposite(WTF::PassRefPtr&lt;WebCore::EditCommand&gt;)
5   0x7f56770e9bf2 WebCore::CompositeEditCommand::moveParagraphs(WebCore::VisiblePosition const&amp;, WebCore::VisiblePosition const&amp;, WebCore::VisiblePosition const&amp;, bool, bool)
6   0x7f56770e8dcf WebCore::CompositeEditCommand::moveParagraph(WebCore::VisiblePosition const&amp;, WebCore::VisiblePosition const&amp;, WebCore::VisiblePosition const&amp;, bool, bool)
7   0x7f5675f6c961 WebCore::ReplaceSelectionCommand::mergeEndIfNeeded()
8   0x7f5675f6f793 WebCore::ReplaceSelectionCommand::doApply()
9   0x7f56770e0f4c WebCore::CompositeEditCommand::apply()
10  0x7f56770e0cfd WebCore::applyCommand(WTF::PassRefPtr&lt;WebCore::CompositeEditCommand&gt;)
11  0x7f5675f43a63
12  0x7f5675f43bad
13  0x7f5675f45585
14  0x7f5675f4959e WebCore::Editor::Command::execute(WTF::String const&amp;, WebCore::Event*) const
15  0x7f5675dedd39 WebCore::Document::execCommand(WTF::String const&amp;, bool, WTF::String const&amp;)
16  0x7f567752022d WebCore::jsDocumentPrototypeFunctionExecCommand(JSC::ExecState*)
17  0x7f560ffff0c8

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f566fcae8a4 in WTFCrash () at ../../Source/WTF/wtf/Assertions.cpp:321
321     *(int *)(uintptr_t)0xbbadbeef = 0;
(gdb) bt
#0  0x00007f566fcae8a4 in WTFCrash () at ../../Source/WTF/wtf/Assertions.cpp:321
#1  0x00007f5675f6c684 in WebCore::ReplaceSelectionCommand::mergeEndIfNeeded (this=0x7f5657290000)
    at ../../Source/WebCore/editing/ReplaceSelectionCommand.cpp:830
#2  0x00007f5675f6f793 in WebCore::ReplaceSelectionCommand::doApply (this=0x7f5657290000) at ../../Source/WebCore/editing/ReplaceSelectionCommand.cpp:1237
#3  0x00007f56770e1220 in WebCore::CompositeEditCommand::applyCommandToComposite (this=0x7f56572fea20, prpCommand=...)
    at ../../Source/WebCore/editing/CompositeEditCommand.cpp:278
#4  0x00007f56770e9bf2 in WebCore::CompositeEditCommand::moveParagraphs (this=0x7f56572fea20, startOfParagraphToMove=..., endOfParagraphToMove=..., 
    destination=..., preserveSelection=false, preserveStyle=true) at ../../Source/WebCore/editing/CompositeEditCommand.cpp:1318
#5  0x00007f56770e8dcf in WebCore::CompositeEditCommand::moveParagraph (this=0x7f56572fea20, startOfParagraphToMove=..., endOfParagraphToMove=..., 
    destination=..., preserveSelection=false, preserveStyle=true) at ../../Source/WebCore/editing/CompositeEditCommand.cpp:1212
#6  0x00007f5675f6c961 in WebCore::ReplaceSelectionCommand::mergeEndIfNeeded (this=0x7f56572fea20)
    at ../../Source/WebCore/editing/ReplaceSelectionCommand.cpp:851
#7  0x00007f5675f6f793 in WebCore::ReplaceSelectionCommand::doApply (this=0x7f56572fea20) at ../../Source/WebCore/editing/ReplaceSelectionCommand.cpp:1237
#8  0x00007f56770e0f4c in WebCore::CompositeEditCommand::apply (this=0x7f56572fea20) at ../../Source/WebCore/editing/CompositeEditCommand.cpp:227
#9  0x00007f56770e0cfd in WebCore::applyCommand (command=...) at ../../Source/WebCore/editing/CompositeEditCommand.cpp:186
#10 0x00007f5675f43a63 in WebCore::executeInsertFragment (frame=..., fragment=...) at ../../Source/WebCore/editing/EditorCommand.cpp:164
#11 0x00007f5675f43bad in WebCore::executeInsertNode(WebCore::Frame &amp;, &lt;unknown type in webkit/WebKitBuild/Debug/lib/libewebkit2.so.1, CU 0x17842d9e, DIE 0x17931fb7&gt;) (frame=..., 
    content=&lt;unknown type in webkit/WebKitBuild/Debug/lib/libewebkit2.so.1, CU 0x17842d9e, DIE 0x17931fb7&gt;)
    at ../../Source/WebCore/editing/EditorCommand.cpp:175
#12 0x00007f5675f45585 in WebCore::executeInsertHorizontalRule (frame=..., value=...) at ../../Source/WebCore/editing/EditorCommand.cpp:470
#13 0x00007f5675f4959e in WebCore::Editor::Command::execute (this=0x7ffe1574b400, parameter=..., triggeringEvent=0x0)
    at ../../Source/WebCore/editing/EditorCommand.cpp:1703
#14 0x00007f5675dedd39 in WebCore::Document::execCommand (this=0x7f5657026a40, commandName=..., userInterface=false, value=...)
    at ../../Source/WebCore/dom/Document.cpp:4657
#15 0x00007f567752022d in WebCore::jsDocumentPrototypeFunctionExecCommand (state=0x7ffe1574b4d0) at DerivedSources/WebCore/JSDocument.cpp:5066
#16 0x00007f560ffff0c8 in ?? ()
#17 0x00007ffe1574b550 in ?? ()
#18 0x00007f566fc57036 in llint_entry () from webkit/WebKitBuild/Debug/lib/libjavascriptcore_efl.so.1</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>