[webkit-help] Fwd: Problem extending WebViewUndoableEditing

Ryosuke Niwa rniwa at webkit.org
Sat Aug 21 11:04:32 PDT 2010


On Sat, Aug 21, 2010 at 8:10 AM, Alexander Shulgin <
alexander.shulgin at yessoftware.com> wrote:

>  Also, there has been a discussion on adding new APIs to allow implement
>> custom editing commands in JavaScript.  So I'm curious to know if
>> that'll suffice your need.  Could you tell us why you'd like to add this
>> feature?
>>
>
> Specifically, we are embedding WebKit into .NET (C#) application which has
> to work on Windows and (with some changes) on Mac OS.
>
> For content editing capabilities we've found that WebKit behavior is often
> surprising or plain broken.  So we've patched it (on Windows) to accept our
> custom editing commands through newly introduced COM interface.  Now, if we
> design the commands carefully we can enjoy arbitrary editing capabilities
> and undo/redo operations work smoothly.
>

I'm sorry about that :(  Could you mind listing problems you had with our
behavior so that we can fix them in the future?

That job is already done on Windows, and now it came to port it to Mac OS,
> where the outer layer (WebKit) is ObjectiveC as opposed to COM/C++ on
> Windows.
>
> The JavaScript would be interesting, but unfortunately, we already have
> tons of C# code for our editing commands and we're unlikely to convert that
> to JavaScript.


I see.

I think I can, but that would be no different from my current approach.  And
> this will just complicate things further w/o the real need for it.
>
> Trying to sketch this move of CustomEditingCommand to WebCore I see the
> strong need for some proxy object (or three separate ``functor objects'') to
> be passed from WebKit to WebCore:
>

Right, the proxy is required but I don't think it's a minus because
EditCommand::* are really meant to be used inside WebCore.  What you really
should be doing is to make your editing commands inherit from
CompositeEditCommmand and use simple commands to do your work because I'm
sure things like splitElement and removeNodePreservingChildren are useful in
any implementation of editing.  That way, you don't have to manually save &
restore states in each of your editing command.

But if you're saying that you've implemented a better SimpleEditCommand's or
found a better way of implementing editing commands, I'm very interested in
knowing what you did because we can take the same approach in WebCore
itself.

Best regards,
Ryosuke Niwa
Software Engineer
Google Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20100821/078de6b0/attachment.html>


More information about the webkit-help mailing list