Closed
Bug 850663
Opened 11 years ago
Closed 11 years ago
Paste from Word doesn't result in HTML in clipboardData
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 586587
People
(Reporter: spocke, Unassigned)
Details
Attachments
(3 files)
643 bytes,
text/html
|
Details | |
32.21 KB,
application/octet-stream
|
Details | |
2.90 KB,
patch
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.33 (KHTML, like Gecko) Chrome/27.0.1430.3 Safari/537.33 Steps to reproduce: 1. Opened the paste_rich.html 2. Opened the test.rtf in Office 2007 on Windows 7. 3. Selected and copied the rich formatted "TEST" from Office. 4. Pasted the rich text into the contentEditable area in paste_rich.html. 5. Observer that it wasn't properly converted to HTML. Actual results: RTF/Word contents isn't properly converted to HTML in clipboardData though converted when inserted into contentEditable. Expected results: RTF/Word contents should be converted into an HTML variant as WebKit/Opera does it.
It's really important for rich text editors like TinyMCE/CKEditor etc to be able to get Word contents as HTML so it can be filtered before inserting it to the editor. This can be done in WebKit and Opera using their Clipboard API implementations but currently not in the Firefox 22 nightly.
Updated•11 years ago
|
Attachment #724412 -
Attachment mime type: text/plain → text/html
Comment 3•11 years ago
|
||
What do you see in the Web Console? I don't have access to a machine with MS Office installed on it at the moment in order to test this.
Comment 4•11 years ago
|
||
I'm guessing that this is because DOMDataTransfer needs to be able to handle kNativeHTMLMime (application/x-moz-nativehtml). This maps to the windows CF_HTML type which is html with some additional header info. See http://msdn.microsoft.com/en-us/library/aa767917%28v=vs.85%29.aspx.
Comment 5•11 years ago
|
||
To be clear, pasting still works fine from Word. (I tested this with Word 2010). The data just isn't reflected in the clipboardData object.
Comment 6•11 years ago
|
||
This patch shows that the nativehtml type can be supported easily. However, it might be more useful (and compatible) to parse the text using nsHTMLEditor::ParseCFHTML or something like it and return it as text/html instead of text/x-moz-nativehtml. This works with the CF_HTML data copied from IE.
Updated•11 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Using Firefox 31.0, bug still exists. Copying formatted text from Word results in clipboardData with 1 type: text/plain, without formatting.
You need to log in
before you can comment on or make changes to this bug.
Description
•