Skip to content
  • a.bah@samsung.com's avatar
    <br> does not get deleted when inlined after some non-textual content. · b024701d
    a.bah@samsung.com authored
    https://bugs.webkit.org/show_bug.cgi?id=120006
    
    Patch by Arpita Bahuguna <a.bah@samsung.com> on 2013-08-23
    Reviewed by Ryosuke Niwa.
    
    Source/WebCore: 
    
    deleteSelectionCommand does not handle the case when a <br> element is
    inlined after some non-textual content (input controls, image etc.).
    
    When doing a back-delete at the start of a line following such a <br>
    the two contiguous lines should merge and the <br> should get deleted.
    Currently, even though the <br> is deleted, another placeholder <br>
    is incorrectly inserted at the same point, thus effectively there is no
    change.
    
    We are incorrectly computing the inline <br> to be at the start of an
    empty line even though the line is not empty.
    
    Test: editing/deleting/delete-inline-br.html
    
    * editing/DeleteSelectionCommand.cpp:
    (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete):
    Adding a check to verify that the inline <br> is not on an empty line
    if the end node is not a <br> element itself and it's previous sibling
    is the start <br> element.
    
    Basically we check whether there is another node (end node) following
    the <br>, that the node is not a <br> itself, and that the end node's
    previous node is the start <br>.
    
    LayoutTests: 
    
    * editing/deleting/delete-inline-br-expected.txt: Added.
    * editing/deleting/delete-inline-br.html: Added.
    Added a testcase that verifies that the caret is placed at the correct
    position after performing a back-delete operation.
    
    * editing/deleting/delete-before-block-image-2-expected.txt:
    * platform/mac/editing/deleting/delete-br-004-expected.txt:
    * platform/mac/editing/deleting/delete-br-005-expected.txt:
    * platform/mac/editing/deleting/delete-br-006-expected.txt:
    * platform/qt/editing/deleting/delete-br-004-expected.txt:
    * platform/qt/editing/deleting/delete-br-005-expected.txt:
    * platform/qt/editing/deleting/delete-br-006-expected.txt:
    Rebaselining existing tests. No visual change in behavior for these tests.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154479 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    b024701d
ChangeLog 2.15 MiB