Replacement text should be available from the marker.
authormorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2012 05:23:21 +0000 (05:23 +0000)
committermorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2012 05:23:21 +0000 (05:23 +0000)
commitfe85222808be32403acbe52282badd7c06d9745b
tree828aacd40f30b24cd1c6be00421ce2508f0f0536
parent41a4d7149ab764f502bd1da1aed6b8b5ff37bab9
Replacement text should be available from the marker.
https://bugs.webkit.org/show_bug.cgi?id=77934

.:

Reviewed by Kent Tamura.

* Source/autotools/symbols.filter: Added an exporting symbol.

Source/WebCore:

Reviewed by Kent Tamura.

On spellchecking, TextCheckingResult can contain a replacement text
which is usable both for an automatic replacement and for showing a suggestion.

But when marking a misspelled word ragarding to returned
TextCheckingResult, Editor uses only the misspelled range data and
discards the replacement value. Then it asks the same value again
when showing suggestion/autocorrection.

It would be great if the marker holds the replacement text
and Editor can use it on suggesting a correction, without any re-request.
This is especially true in the case when it needs IPC messaging for spellchecking:
We can save one round-trip by this technique.

Here is actual change:

- Passed the replacement text to addMarker() for for misspelling markers.
  Note that this is done only for the unified checker path because legacy
  TextCheckerClient API doesn't provide such a replacement.
- Added an Internals API to retrieve a description text on a marker.

Test: editing/spelling/spelling-marker-description.html

* WebCore.exp.in:
* editing/Editor.cpp:
(WebCore::Editor::markAndReplaceFor):
* testing/Internals.cpp:
(WebCore::Internals::markerAt):
(WebCore):
(WebCore::Internals::markerRangeForNode):
(WebCore::Internals::markerDescriptionForNode):
* testing/Internals.h:
(WebCore):
(Internals):
* testing/Internals.idl:

Source/WebKit/chromium:

didFinishCheckingText() accidentally dropped the description text
given from the backend. Fixed to copy it on the API-to-Core
convertion. The test won't work without this fix.

Reviewed by Kent Tamura.

* src/WebTextCheckingCompletionImpl.cpp:
(WebKit::toCoreResults):

Source/WebKit/win:

Reviewed by Kent Tamura.

* WebKit.vcproj/WebKit_Cairo.def:
* WebKit.vcproj/WebKit_Cairo_debug.def:

Source/WebKit2:

Reviewed by Kent Tamura.

* win/WebKit2.def:
* win/WebKit2CFLite.def:

Tools:

Made the mock requestCheckingOfText() implementation to return
a replacement text for each misspelled word if available.

Reviewed by Kent Tamura.

* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::finishLastTextCheck):

LayoutTests:

Reviewed by Kent Tamura.

* editing/spelling/spelling-marker-description-expected.txt: Added.
* editing/spelling/spelling-marker-description.html: Added.
* platform/gtk/Skipped:
* platform/mac/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107176 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/editing/spelling/spelling-marker-description-expected.txt [new file with mode: 0644]
LayoutTests/editing/spelling/spelling-marker-description.html [new file with mode: 0644]
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/mac/Skipped
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/editing/Editor.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebKit.vcproj/WebKit_Cairo.def
Source/WebKit/win/WebKit.vcproj/WebKit_Cairo_debug.def
Source/WebKit2/ChangeLog
Source/WebKit2/win/WebKit2.def
Source/WebKit2/win/WebKit2CFLite.def
Source/autotools/symbols.filter
Tools/ChangeLog
Tools/DumpRenderTree/chromium/WebViewHost.cpp