Skip to content
  • sergio@webkit.org's avatar
    Show a block cursor in overtype mode · 242f7660
    sergio@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=114819
    
    Reviewed by Ryosuke Niwa.
    
    .:
    
    * Source/autotools/symbols.filter: export some extra symbols for
    testing purposes.
    
    Source/WebCore:
    
    Test: editing/selection/block-cursor-overtype-mode.html
    
    Overtype mode will use block cursor instead of a caret to
    highlight the next character to be replaced. It will fully cover
    the next character to be replaced (except at the end of a line
    where the usual blinking caret will be shown).
    
    This new block cursor is internally implemented as a selection
    (not exposed to JavaScript) because the selection code knows how
    to deal with bidi text.
    
    * WebCore.exp.in: Export symbols for testing purposes.
    * WebCore.order: Ditto.
    * editing/Editor.cpp:
    (WebCore::Editor::toggleOverwriteModeEnabled): Added a call to
    FrameLoader::setShouldShowBlockCursor.
    (WebCore):
    * editing/Editor.h:
    (Editor):
    * editing/FrameSelection.cpp:
    (WebCore::FrameSelection::FrameSelection):
    (WebCore::FrameSelection::updateAppearance): Use a 1-character
    long selection to paint the cursor in overtype mode.
    (WebCore::FrameSelection::setShouldShowBlockCursor):
    (WebCore):
    * editing/FrameSelection.h:
    (WebCore::FrameSelection::shouldShowBlockCursor):
    (FrameSelection):
    * testing/Internals.cpp:
    (WebCore):
    (WebCore::Internals::selectionBounds): Added a new method which
    returns the IntRect issued by FrameSelection::bounds().
    * testing/Internals.h: Ditto.
    * testing/Internals.idl: Ditto.
    
    Source/WebKit:
    
    Export three more WebCore symbols.
    
    * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
    
    Source/WebKit/win:
    
    Export three more WebCore symbols.
    
    * WebKit.vcproj/WebKitExports.def.in:
    
    LayoutTests:
    
    New test case for the new block cursor to be used in overtype
    mode. The test verifies that the 1-pixel long caret is replaced by
    a selection like 1-character long block cursor when in overtype
    mode. This test covers LTR and RTL text in LTR and RTL blocks and
    bidi text.
    
    * editing/selection/block-cursor-overtype-mode-expected.txt: Added.
    * editing/selection/block-cursor-overtype-mode.html: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    242f7660