[webkit-qt] Adding inline spell checking to webkit-qt
Lindsay Mathieson
lindsay.mathieson at gmail.com
Tue Jul 19 15:27:47 PDT 2011
On 19 July 2011 16:45, Dawit A <adawit at kde.org> wrote:
>
> OK, I took a look and here is my first impression:
>
> * First and foremost, you need to do some house keeping work. That is
> you need to run "Tools/Scripts/check-webkit-style" to make sure you
> adhere to webkit coding style. I see a lot of incorrect indentations,
> extra whitespaces and other coding style violations that will get your
> patch rejected from the get go.
Will do
>
> * I do not think a uchar* should be exposed in the Qt plugin API for
> the spell checker. It should instead be converted to a QString or a
> QByteArray, which ever one is appropriate, and the conversion to and
> from uchar* should be handled internally.
Ok
>
> * I think you are supposed to use OwnPtr for m_spellChecker in
> EditorClientQt.* instead of a raw pointer variable.
I'll look into that
>
> * 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
--
Lindsay
More information about the webkit-qt
mailing list