Skip to content
  • sergio@webkit.org's avatar
    Empty list items after drag&drop in contentEditable divs · 962751c6
    sergio@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=110610
    
    Reviewed by Ryosuke Niwa.
    
    Source/WebCore:
    
    Perform a cleanup after moving operations. This will mainly prune
    extra placeholders left by the editing algorithms. Also do not
    leave empty <li> when moving them around inside a list element.
    
    Tests: editing/pasteboard/cleanup-on-move.html
           editing/pasteboard/drag-list-item.html
    
    * editing/MoveSelectionCommand.cpp:
    (WebCore::MoveSelectionCommand::doApply): perform
    cleanupAfterDeletion().
    * editing/ReplaceSelectionCommand.cpp:
    (WebCore::ReplaceSelectionCommand::insertAsListItems): do not
    insert an empty list item.
    * editing/MoveSelectionCommand.cpp:
    (WebCore::MoveSelectionCommand::doApply):
    * editing/ReplaceSelectionCommand.cpp:
    (WebCore::ReplaceSelectionCommand::insertAsListItems):
    
    LayoutTests:
    
    Some placeholders should not be left after performing a cleanup in
    move operations, this includes the empty list items generated when
    moving around list items inside a list.
    
    I'm also moving drag-list-item.html to editing/pasteboard because
    it fits much better there than under editing/selection.
    
    * editing/pasteboard/cleanup-on-move-expected.txt: Added.
    * editing/pasteboard/cleanup-on-move.html: Added.
    * editing/pasteboard/drag-list-item-expected.txt: Renamed from LayoutTests/editing/selection/drag-list-item-expected.txt.
    * editing/pasteboard/drag-list-item.html: Renamed from LayoutTests/editing/selection/drag-list-item.html.
    * editing/pasteboard/resources/select-and-drag.js: Added.
    (selectAndDragToTarget): Selects nodes and drops them after a target node.
    * editing/pasteboard/drag-drop-list-expected.txt: Removed an empty <li>.
    * editing/pasteboard/paste-list-004-expected.txt: Removed 2 empty <li>.
    * editing/pasteboard/paste-list-004.html: Ditto.
    * editing/selection/4895428-1-expected.txt: Removed a <br>.
    * editing/selection/4895428-4-expected.txt: Ditto.
    * fast/events/ondragenter-expected.txt: Removed a blank line.
    * platform/chromium/fast/events/ondragenter-expected.txt: Ditto.
    * platform/efl/TestExpectations: Added cleanup-on-move.html to the skipped list.
    * platform/mac-wk2/TestExpectations: Ditto.
    * platform/qt/TestExpectations: Ditto.
    * platform/win/fast/events/ondragenter-expected.txt: Removed a blank line.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    962751c6