[webkit-qt] Spellchecking support for WebKit2
Simon Hausmann
simon.hausmann at digia.com
Tue Jan 8 05:17:38 PST 2013
On Tuesday, January 08, 2013 12:36:42 PM Jose Dapena Paz wrote:
> Hi,
>
> I've been implementing a patch for adding spellcheck support for Qt
> WebKit2. The work for this is in this bug:
> https://bugs.webkit.org/show_bug.cgi?id=105034
>
> It exposes the spellcheck functionality on the new Quick components for
> WebKit2. Next days I'll go on iterating over the patch, but I'd need
> some feedback mainly on the proposed API (though please feel free to
> point to anything else you could find relevant).
>
> The main issue with the current implementation is about exposing the
> spellchecker in QML. In WebKit2, there's support for one global
> spellchecker, so it is not specific to any web view, but shared among
> them. The way I exposed this was adding a new property to WebView for
> accessing the global variables (only spellchecker now).
>
> So the API for setting a specific spellchecker is something like:
> WebView {
> ...
> experimental.shared.textChecker: WebTextCheckerEnchant {
> enabled: true
> languages: ["en"]
> }
>
> But... yes, it is a weird way to access a global. Any hint on the "right
> way" to expose global properties like this in QML?
>
> The other big question to discuss is... Ok, we need spell checking
> support in WebKit, and it is important to define an API that allows to
> plug different spellcheck engines as provided by different platforms.
> But seems an API like this would be also interesting at a more global
> scope (i.e. at Qt, enabling to add spell check for non WebKit
> applications...). My proposal, now, is pushing for this only in WebKit,
> as I need this working in the short term. But... What about long term?
My feeling is that from an API perspective spell checking should simply work
out of the box if it's supported by the underlying platform. I do hope that
we'll get a spell checking API into Qt at some point and libenchant looks
indeed promising for Linux.
As a developer I don't want to have to make a choice about which API to use or
implement my own spell checker. But I may want to configure a few settings
perhaps (which ones?) and I think I want to have full control over the UI.
Simon
More information about the webkit-qt
mailing list