Bug 41085 - "Paste and Match Style" should fire paste events
Summary: "Paste and Match Style" should fire paste events
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Adele Peterson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-23 11:26 PDT by Adele Peterson
Modified: 2010-06-24 15:49 PDT (History)
0 users

See Also:


Attachments
patch (3.86 KB, patch)
2010-06-23 11:29 PDT, Adele Peterson
no flags Details | Formatted Diff | Diff
patch (5.30 KB, patch)
2010-06-23 21:41 PDT, Adele Peterson
eric.carlson: review+
Details | Formatted Diff | Diff
updated fix (5.91 KB, patch)
2010-06-24 14:06 PDT, Adele Peterson
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adele Peterson 2010-06-23 11:26:13 PDT
"Paste and Match Style" should fire paste events
Comment 1 Adele Peterson 2010-06-23 11:29:34 PDT
Created attachment 59541 [details]
patch
Comment 2 Adele Peterson 2010-06-23 13:56:35 PDT
Comment on attachment 59541 [details]
patch

clearing the flag.  I need to fix up DumpRenderTree.  The pasteboard doesn't get totally blown away when setting data on the ClipboardData object in later tests.
Comment 3 Adele Peterson 2010-06-23 21:41:06 PDT
Created attachment 59610 [details]
patch

I'm not totally sure this is the best way to clear the pasteboard in between tests, but it seems to work.
Comment 4 Adele Peterson 2010-06-24 10:38:26 PDT
Committed revision 61771.
Comment 5 Darin Adler 2010-06-24 12:15:14 PDT
Comment on attachment 59610 [details]
patch

I don’t understand why the RetainPtr and RefPtr are needed.

Two other thoughts:

    1) Use a named editor command PasteAsPlainText for this and eliminate the method entirely. We'd add this to the WEBCORE_COMMAND macro section of the file. This could help us in the future when reimplementing for WebKit2.

    2) We should consider removing _pasteAsPlainTextWithPasteboard and readSelectionFromPasteboard. I'm not sure why these methods exist.
Comment 6 Adele Peterson 2010-06-24 12:42:37 PDT
(In reply to comment #5)
> (From update of attachment 59610 [details])
> I don’t understand why the RetainPtr and RefPtr are needed.

This is what's done in the paste selector.  When the paste event fires, maybe the WebView could go away.  I'm not sure.

> 
> Two other thoughts:
> 
>     1) Use a named editor command PasteAsPlainText for this and eliminate the method entirely. We'd add this to the WEBCORE_COMMAND macro section of the file. This could help us in the future when reimplementing for WebKit2.

Good idea!
> 
>     2) We should consider removing _pasteAsPlainTextWithPasteboard and readSelectionFromPasteboard. I'm not sure why these methods exist.

I'll investigate this.
Comment 7 Adele Peterson 2010-06-24 14:06:27 PDT
Created attachment 59700 [details]
updated fix

Here's a patch that removes those unused methods and uses the WebCore command system for pasteAsPlainText.
Comment 8 Adele Peterson 2010-06-24 15:49:59 PDT
Updated fix in revision 61794.