Skip to content
  • sergio@webkit.org's avatar
    Inserting a blank (" ") at the end of a line does not insert anything in Overtype mode · 147de161
    sergio@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=113413
    
    Reviewed by Ryosuke Niwa.
    
    Source/WebCore:
    
    Perform a "normal" insert instead of a replace when there is
    nothing to replace (like at the end of a line) as this case is not
    supported by the replacing code path. This will allow us to
    properly rebalance whitespaces in those cases.
    
    Updated the editing/execCommand/overtype.html test to check also
    this use case.
    
    * editing/InsertTextCommand.cpp:
    (WebCore::InsertTextCommand::setEndingSelectionWithoutValidation):
    (WebCore::InsertTextCommand::performTrivialReplace):
    (WebCore::InsertTextCommand::performOverwrite):
    (WebCore::InsertTextCommand::doApply): use the recently added
    setEndingSelectionWithoutValidation() to avoid code duplication.
    * editing/InsertTextCommand.h:
    (InsertTextCommand):
    
    LayoutTests:
    
    Updated the test to include the case of inserting a whitespace
    both in the middle or at the end of a line.
    
    * editing/execCommand/overtype-expected.txt:
    * editing/execCommand/overtype.html:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    147de161