[webkit-qt] Adding inline spell checking to webkit-qt

Dawit A adawit at kde.org
Wed Jul 20 00:14:13 PDT 2011

On Tue, Jul 19, 2011 at 6:27 PM, Lindsay Mathieson
<lindsay.mathieson at gmail.com> wrote:
> On 19 July 2011 16:45, Dawit A <adawit at kde.org> wrote:
>> * I fail to see how the spell checker code retrieves a list of
>> replacement words for the misspelled one with the current API. More
>> specifically, when a misspelled word gets highlighted, how does the
>> user go about correcting the misspelling ?
>> Perhaps I fail to see how because I do not yet fully understand the
>> TextCheckClient.* completely..
> This will no doubt  be the tricky bit ;) After some thought and
> digging on this I believe its not QtWebKits place to provide a UI for
> this, rather its up to the hosting browser, anything else would
> interfere with the hosting UI. If you look at three common hosting
> environments, rekonq konqueror and Arora, they all provide their own
> context menu's et al. Konqueror, when using KHTML integrates the the
> spell check replacement words and options with its context menu and
> users would expect to see the same when its using QtWebKit. Given that
> typically the host will be implementing the QWebKitPlatformPlugin and
> supplying the spellchecker for it, it should be that difficult.
> In short, what I envisiage is:
> - Host implements QWebKitPlatformPlugin
> - QtWebkit uses that to display underlining and/or autocorrect as needed
> - Host looks up word alternatives on Context Menu events

Right, but the problem I have is exactly at this point. How is the
host, say kdewebkit, supposed to know whether or not the word upon
which the user just clicked in a misspelled word ? That is the part I
do not yet understand. Is there currently a mechanism for that or does
one need to be added to the QWebHitTestResult class for example ?
Perhaps it would help if I spend sometime looking into how spell
checking works elsewhere, but the answer to this is not apparent to me
at this point.  after only looking at your patches and some of the
related classes like TextCheckerClient. :(

More information about the webkit-qt mailing list