[webkit-help] Fwd: Problem extending WebViewUndoableEditing

Ryosuke Niwa rniwa at webkit.org
Fri Aug 20 12:40:31 PDT 2010


Try adding those methods you're using to WebCore.exp.in as well.  But I'm
afraid that you're sort of breaking the abstraction layer here.  Why can't
you put your CustomWebCoreEditingCommand in WebCore and have it provide some
interface to WebKit?  I definitely don't want see EditCommand::* be exposed
to WebKit if you're trying to commit your changes.

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?

Best,
Ryosuke Niwa
Software Engineer
Google Inc.

On Fri, Aug 20, 2010 at 8:30 AM, Alexander Shulgin <
alexander.shulgin at yessoftware.com> wrote:

> Hi,
>
> I'm trying to add this functionality which will allow us to execute
> arbitrary undoable content editing commands.
>
> I've added new editing command interface like this:
>
> @interface WebEditingCommand : NSObject {
> }
> - (void)apply;
> - (void)unapply;
> - (void)reapply;
> @end
>
> In WebKit/mac/WebView/WebView.h I've extended WebViewUndoableEditing like
> this:
>
> @interface WebView (WebViewUndoableEditing)
> - (void)replaceSelectionWithNode:(DOMNode *)node;
> - (void)replaceSelectionWithText:(NSString *)text;
> - (void)replaceSelectionWithMarkupString:(NSString *)markupString;
> - (void)replaceSelectionWithArchive:(WebArchive *)archive;
> - (void)deleteSelection;
> - (void)applyStyle:(DOMCSSStyleDeclaration *)style;
>
> // *** added this line:
> - (void)applyEditingCommand:(WebEditingCommand *)command;
> @end
>
> Then I've added a new C++ class CustomWebCoreEditingCommand which is
> inherited from WebCore::SimpleEditCommand (please see attached files) and
> put it under WebKit/mac/WebCoreSupport.  Also added these new files to XCode
> project.
>
> Now then I compile the whole thing I get these linker errors:
>
> Undefined symbols:
>  "__ZNK7WebCore11EditCommand19isInsertTextCommandEv", referenced from:
>      __ZTV27CustomWebCoreEditingCommand in CustomWebCoreEditingCommand.o
>      __ZTVN7WebCore17SimpleEditCommandE in CustomWebCoreEditingCommand.o
>  "__ZN7WebCore11EditCommand9doReapplyEv", referenced from:
>      __ZTVN7WebCore17SimpleEditCommandE in CustomWebCoreEditingCommand.o
> ...
> (more messages like this all related to WebCore::EditCommand::something)
>
> For no obvious reason it complains about not being able to find these
> symbols from WebCore::EditCommand, while they are certainly there in the
> WebCore library...  I even checked with nm tool to see if name mangling is
> the same, and it is.
>
> I originally tried it with ObjC++ files which gave me exactly the same
> linking problem.  So now I tried to separate C++ and ObjectiveC
> (square-bracket calls on WebEditingCommand interface moved to
> WebEditingCommandCppBridge.mm file), but to no avail.
>
> Later I noticed there are several C++ classes in WebCoreSupport folder
> which inherit some WebCore class but use some ObjC syntax w/o any problem.
>  Why doesn't this work for my class?
>
> Am I missing something?
>
> --
> Regards,
> Alex
>
> _______________________________________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-help
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20100820/a589ef30/attachment.html>


More information about the webkit-help mailing list