<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 - REGRESSION(r200931): Invalid cast in highestAncestorToWrapMarkup()"
   href="https://bugs.webkit.org/show_bug.cgi?id=160163">160163</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>REGRESSION(r200931): Invalid cast in highestAncestorToWrapMarkup()
          </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>Keywords</th>
          <td>Gtk, LayoutTestFailure
          </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>cgarcia&#64;igalia.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>bugs-noreply&#64;webkitgtk.org, cdumez&#64;apple.com, darin&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Since r200931 the result of enclosingNodeOfType() in highestAncestorToWrapMarkup() is downcasted to Element, but the result of enclosingNodeOfType() can be a Node that is not an Element, in this case is Text. The following tests are failing in GTK+ Debug bot because of this:

editing/execCommand/format-block-from-range-selection.html
editing/execCommand/indent-nested-lists-7.html
editing/execCommand/remove-format-elements.html
editing/execCommand/remove-format-orphaned-list-item.html

The cast is not needed at all since that node is passed to editingIgnoresContent() and selectionFromContentsOfNode() and both receive a Node not an Element.

STDERR: ASSERTION FAILED: !source || is&lt;Target&gt;(*source)
STDERR: ../../Source/WTF/wtf/TypeCasts.h(89) : typename WTF::match_constness&lt;Source, Target&gt;::type* WTF::downcast(Source*) [with Target = WebCore::Element; Source = WebCore::Node; typename WTF::match_constness&lt;Source, Target&gt;::type = WebCore::Element]
STDERR: 1   0x7fc28ad6692f /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libjavascriptcoregtk-4.0.so.18(WTFCrash+0x1e) [0x7fc28ad6692f]
STDERR: 2   0x7fc28ad66945 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libjavascriptcoregtk-4.0.so.18(+0x2213945) [0x7fc28ad66945]
STDERR: 3   0x7fc291bf34af /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WTF::match_constness&lt;WebCore::Node, WebCore::Element&gt;::type* WTF::downcast&lt;WebCore::Element, WebCore::Node&gt;(WebCore::Node*)+0x4a) [0x7fc291bf34af]
STDERR: 4   0x7fc2921f6346 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(+0x61e8346) [0x7fc2921f6346]
STDERR: 5   0x7fc2921f6ae4 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(+0x61e8ae4) [0x7fc2921f6ae4]
STDERR: 6   0x7fc2921f76c7 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebCore::createMarkup(WebCore::Range const&amp;, WTF::Vector&lt;WebCore::Node*, 0ul, WTF::CrashOnOverflow, 16ul&gt;*, WebCore::EAnnotateForInterchange, bool, WebCore::EAbsoluteURLs)+0x5d) [0x7fc2921f76c7]
STDERR: 7   0x7fc291826994 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebKit::WebEditorClient::updateGlobalSelection(WebCore::Frame*)+0x186) [0x7fc291826994]
STDERR: 8   0x7fc2916304f5 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebKit::WebEditorClient::respondToChangedSelection(WebCore::Frame*)+0xd7) [0x7fc2916304f5]
STDERR: 9   0x7fc2921787fb /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebCore::Editor::respondToChangedSelection(WebCore::VisibleSelection const&amp;, unsigned int)+0x51) [0x7fc2921787fb]
STDERR: 10  0x7fc292189691 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance(WebCore::VisibleSelection const&amp;, unsigned int, WebCore::FrameSelection::CursorAlignOnScroll, WebCore::TextGranularity)+0x41d) [0x7fc292189691]
STDERR: 11  0x7fc2921897c9 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebCore::FrameSelection::setSelection(WebCore::VisibleSelection const&amp;, unsigned int, WebCore::AXTextStateChangeIntent, WebCore::FrameSelection::CursorAlignOnScroll, WebCore::TextGranularity)+0x3f) [0x7fc2921897c9]
STDERR: 12  0x7fc292175e7b /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebCore::Editor::changeSelectionAfterCommand(WebCore::VisibleSelection const&amp;, unsigned int)+0x177) [0x7fc292175e7b]
STDERR: 13  0x7fc29216b0ac /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebCore::Editor::appliedEditing(WTF::PassRefPtr&lt;WebCore::CompositeEditCommand&gt;)+0x11a) [0x7fc29216b0ac]
STDERR: 14  0x7fc29213a664 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebCore::CompositeEditCommand::apply()+0x12a) [0x7fc29213a664]
STDERR: 15  0x7fc29213a3b1 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebCore::applyCommand(WTF::PassRefPtr&lt;WebCore::CompositeEditCommand&gt;)+0x20) [0x7fc29213a3b1]
STDERR: 16  0x7fc29217f8c6 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(+0x61718c6) [0x7fc29217f8c6]
STDERR: 17  0x7fc292183e08 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebCore::Editor::Command::execute(WTF::String const&amp;, WebCore::Event*) const+0xa8) [0x7fc292183e08]
STDERR: 18  0x7fc291feb0a6 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebCore::Document::execCommand(WTF::String const&amp;, bool, WTF::String const&amp;)+0x56) [0x7fc291feb0a6]
STDERR: 19  0x7fc2932b0b87 /home/slave/webkitgtk/gtk-linux-64-debug/build/WebKitBuild/Debug/lib/libwebkit2gtk-4.0.so.37(WebCore::jsDocumentPrototypeFunctionExecCommand(JSC::ExecState*)+0x2e3) [0x7fc2932b0b87]
STDERR: 20  0x7fc239dfe028 [0x7fc239dfe028]</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>