Last Comment Bug 741734 - "paste withoug formatting" doesn't fire OnPaste event in contenteditable element
: "paste withoug formatting" doesn't fire OnPaste event in contenteditable element
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Editor (show other bugs)
: 11 Branch
: x86_64 Linux
: -- normal (vote)
: mozilla14
Assigned To: :Ehsan Akhgari (away Aug 1-5)
:
Mentors:
http://jsfiddle.net/DW57a/
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-03 03:38 PDT by Thomas Broyer
Modified: 2012-04-04 04:55 PDT (History)
4 users (show)
ehsan: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (v1) (2.02 KB, patch)
2012-04-03 10:41 PDT, :Ehsan Akhgari (away Aug 1-5)
roc: review+
Details | Diff | Splinter Review

Description Thomas Broyer 2012-04-03 03:38:57 PDT
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.1 Safari/536.5

Steps to reproduce:

Ctrl+Shift+V (on Windows or Linux; Cmd+Option+Shift+V on Mac) within a contenteditable div.


Actual results:

Text pasted without formatting, but no event is fired.


Expected results:

A paste event should have been fired.

Try it here http://jsfiddle.net/DW57a/
Comment 1 Thomas Broyer 2012-04-03 06:14:19 PDT
Paste and PasteTransferable both start with a call to FireClipboardEvent(NS_PASTE), but not PasteNoFormatting:
http://hg.mozilla.org/mozilla-central/file/c410b2d6d570/editor/libeditor/html/nsHTMLDataTransfer.cpp#l1625
Comment 2 :Ehsan Akhgari (away Aug 1-5) 2012-04-03 10:41:42 PDT
Created attachment 611881 [details] [diff] [review]
Patch (v1)
Comment 3 Robert O'Callahan (:roc) (Exited; email my personal email if necessary) 2012-04-03 13:22:29 PDT
Comment on attachment 611881 [details] [diff] [review]
Patch (v1)

Review of attachment 611881 [details] [diff] [review]:
-----------------------------------------------------------------

::: editor/libeditor/html/tests/test_bug410986.html
@@ +57,4 @@
>            synthesizeKey("V", {accelKey: true});
>            isnot(ed.innerHTML.indexOf("<span style=\"color: green;\">green text</span>"), -1,
>                  "Content should be pasted in HTML format");
> +          is(gPasteEvents, 2, "One paste event must be fired");

Fix string
Comment 5 Marco Bonardo [::mak] (Away 6-20 Aug) 2012-04-04 04:55:33 PDT
https://hg.mozilla.org/mozilla-central/rev/a154bf84abdb

Note You need to log in before you can comment on or make changes to this bug.