On WebKit text editors

Elliott Sales de Andrade qulogic at pidgin.im
Sun Jun 2 20:42:19 EDT 2013


In case you were not aware, one of the biggest changes for 3.0.0 is
the switch to WebKit. It is used for both the display of messages in
the conversation and (ideally) the input of text from the user. While
the display situation is pretty much working (apart from smileys,
possibly), the input side is somewhat lacking.

Being one of the few people working on it, I can pretty well say that
the API for editing in WebKit is terrible. It's basically whatever got
put into browsers meaning no real standardization and you can't really
do the stuff you'd expect considering you're on the "other side" of
the browser.

To that end, I wonder what everyone would think about just using some
existing HTML/JS editor component for our input entry? The people who
have created them have likely faced every possible problem or quirk in
the browser already. It provides some forwards compatibility with
WebKit2, where the browser process is separate and we'd basically have
to convert to JS anyway. The fact that they can be themed might be of
interest to some people as well.

I think two of the better choices are TinyMCE or CKEditor. They've
both got compatible licenses, limited (or no) dependencies, themes,
smileys, plugins, etc. that would be useful for us. There may be
others; I did not look extensively.

Possible drawbacks:
- Not our code, but we'll need JS anyway and we don't seem to be
experts so far (that I can tell).
- Somewhat bloated since they (generally) support all browsers and we
only care about WebKit.
- We'd probably need to write something to do WBFO, but they've both
got plugin systems that could do it.
- Dialogs might be tricky. The "Insert Link" or "Insert Smiley"
buttons normally create a popup, which would be a problem on a
two-line high entry. We might have to do some interface with our code
to get that into native windows or something.

Anyway, what do you think of this idea? Our editor right now is good
enough for relatively simple things, but it really doesn't support
everything we had. And it's really really fragile, getting stuck in
infinite loops if you change things too much.

Elliott aka QuLogic
Pidgin developer

More information about the Devel mailing list