Closed Bug 741734 Opened 12 years ago Closed 12 years ago

"paste withoug formatting" doesn't fire OnPaste event in contenteditable element

Categories

(Core :: DOM: Editor, defect)

11 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: t.broyer, Assigned: ehsan.akhgari)

References

()

Details

Attachments

(1 file)

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/
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
Attached patch Patch (v1)Splinter Review
Attachment #611881 - Attachment is patch: true
Attachment #611881 - Flags: review?(roc)
Assignee: nobody → ehsan
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
Attachment #611881 - Flags: review?(roc) → review+
Landed https://hg.mozilla.org/integration/mozilla-inbound/rev/afff429aaf9a with a bad commit message, backed it out in https://hg.mozilla.org/integration/mozilla-inbound/rev/ca51e71184bb and relanded in https://hg.mozilla.org/integration/mozilla-inbound/rev/a154bf84abdb.
Flags: in-testsuite+
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/a154bf84abdb
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: