[Webkit-unassigned] [Bug 26791] [Gtk] Paste of rich text from firefox results garbled markup

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 7 05:44:30 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=26791





--- Comment #25 from Jiahua Huang <jhuangjiahua at gmail.com>  2009-07-07 05:44:29 PDT ---
(In reply to comment #24)
> (From update of attachment 32264 [details])
> > -        String html = String::fromUTF8(reinterpret_cast<gchar*>(data->data), data->length * data->format / 8);
> > +        String html;
> > +        RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("text/plain", "UTF-8", true);
> > +        html = decoder->decode(reinterpret_cast<char*>(data->data), data->length);
> > +        html += decoder->flush();
> >          gtk_selection_data_free(data);
> 
> Declaration and the first assignment can be in the same line here. 
> 
> Looks fine and the patch works great! r=me.

Thank you, Jan,

I appreciate your comments.


I observ'd also, 
when I select some html content, and Copy them use Ctrl-C,
the Pasteboard/GtkClipboard can't handle the "text/html" target.

I found that the "text/html" target 
only in X clipboard (GDK_SELECTION_CLIPBOARD),
but not Desktop clipboard (GDK_SELECTION_PRIMARY).

So we can't use Ctrl-C to Copy rich text from WebkitGtk.

I use this Change:
> Index: WebCore/platform/gtk/PasteboardGtk.cpp
> ===================================================================
> --- WebCore/platform/gtk/PasteboardGtk.cpp	(revision 45546)
> +++ WebCore/platform/gtk/PasteboardGtk.cpp	(working copy)
> @@ -37,8 +38,8 @@ namespace WebCore {
>  /* FIXME: we must get rid of this and use the enum in webkitwebview.h someway */
>  typedef enum
>  {
> -    WEBKIT_WEB_VIEW_TARGET_INFO_HTML = - 1,
> -    WEBKIT_WEB_VIEW_TARGET_INFO_TEXT = - 2
> +    WEBKIT_WEB_VIEW_TARGET_INFO_HTML,
> +    WEBKIT_WEB_VIEW_TARGET_INFO_TEXT
>  } WebKitWebViewTargetInfo;
> 

it works.
it can use Ctrl-C to Copy rich text from WebkitGtk page now.


but I'm not sure if it will be a new patch.

Jan, should fix it when landing,
or should I create a new patch with ChangeLog,
or open a new Bug?


Regards

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list