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

RESOLVED FIXED in mozilla14

Status

()

Core
Editor
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Thomas Broyer, Assigned: Ehsan)

Tracking

11 Branch
mozilla14
x86_64
Linux
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
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/
(Reporter)

Updated

5 years ago
(Reporter)

Comment 1

5 years ago
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
Created attachment 611881 [details] [diff] [review]
Patch (v1)
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.