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