Show a block cursor in overtype mode
authorsergio@webkit.org <sergio@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 May 2013 14:17:12 +0000 (14:17 +0000)
committersergio@webkit.org <sergio@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 May 2013 14:17:12 +0000 (14:17 +0000)
commit06bd99375c7373a362357782506be96d3f23b9ce
tree4cc0a021f4c5ece320cb36bde4a4b7bcb4fee306
parente407f9ca467129a3cb39f15c314bf03ffeedbc7b
Show a block cursor in overtype mode
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: https://svn.webkit.org/repository/webkit/trunk@149432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/editing/selection/block-cursor-overtype-mode-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/block-cursor-overtype-mode.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.order
Source/WebCore/editing/Editor.cpp
Source/WebCore/editing/Editor.h
Source/WebCore/editing/FrameSelection.cpp
Source/WebCore/editing/FrameSelection.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit/ChangeLog
Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in
Source/autotools/symbols.filter