Bug 41085

Summary: "Paste and Match Style" should fire paste events
Product: WebKit Reporter: Adele Peterson <adele>
Component: HTML EditingAssignee: Adele Peterson <adele>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
patch
none
patch
eric.carlson: review+
updated fix sam: review+

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.