Closed Bug 1354452 Opened 8 years ago Closed 8 years ago

When copying HTML fragment containing text and embedded cid: image, no "text only" flavour is placed onto the clipboard (HTML flavour only) - Copying text and image doesn't paste text into Notepad

Categories

(Thunderbird :: Message Reader UI, defect)

52 Branch
x86
Windows 7
defect
Not set
normal

Tracking

(thunderbird_esr5253+ fixed, thunderbird53 fixed, thunderbird54 fixed, thunderbird55 fixed)

RESOLVED FIXED
Thunderbird 55.0
Tracking Status
thunderbird_esr52 53+ fixed
thunderbird53 --- fixed
thunderbird54 --- fixed
thunderbird55 --- fixed

People

(Reporter: petr, Assigned: jorgk-bmo)

References

Details

Attachments

(4 files, 1 obsolete file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Steps to reproduce: Open mail in html format with included images (ex. company logo in signature). Press Ctrl+A then Ctrl+C to copy whole mail. Run notepad.exe and press Ctrl+V Actual results: Mail plain text is not copied. Expected results: Copy plain text of mail to notepad.
Same thing in safe mode? https://support.mozilla.org/en-US/kb/safe-mode-thunderbird If works in safe mode, please determine which addon is at fault, post the name here, and notify the author of the addon
Component: Mail Window Front End → Message Reader UI
OS: Unspecified → Linux
OS: Linux → Windows 7
Hardware: Unspecified → x86
Same in safe mode. Text is not copied.
Does bug 1235454 also happen for you? Does it seem like same problem?
Yes, bug 1235454 also happen in Thunderbird 52.0. But it seems like other problem. In compose window select all and copy text works. While reading incoming emails, not all formats are copied to windows clipboard.
Attached image clipboard-content.png (deleted) —
Notice missing formats: Text, Unicode Text Format
Attached file HTML mail with picture in the text (deleted) —
I can confirm this Bug. Select some text with the picture. copy and paste -> result: no text is pasted Regression window: Last good: Thunderbird (52.0a1) - Daily BuildID=20161109190331 Rev: Comm-Central:dc1b2bd19227 / Mozilla-Central:336759fad462 First bad: Thunderbird (52.0a1) - Daily BuildID=20161112064932 Rev: Comm-Central:228b399d8933 / Mozilla-Central:fc104971a4db
Caused by bug 1315480. Use FreeClipViewer.exe to see the clipboard. When copying from the message in attachment 8855853 [details] I get this clipboard on Windows: <html><body> <!--StartFragment-->HTML <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAYAAAAmlE46AAAA0UlEQVQokYWTsQ3EIAxFM2FWyBYUrEHDGu7TWkrNAAiJIj0N5b/iZB9xEs6IAsHj+2O8YBKUCaXVx71lXHR0lFZxnAzKBMceIUV09DlYWgVlAmVCSBEhRTj2qlpa1UsuoCiNoCiGFLHum140VXTsdb3um07H/gv2YYiqqIlXx/4CL3J4nDbVR1BecfRn030ExZsFrZqURvZfwSdFgbUcFjxORmn1NdWQ4u9VxacU+Tj5v0cbUs83UD3akHTHGjr2mtHty41q9kPYLrl1x6yVxvgAgFf0dZrumY4AAAAASUVORK5CYII=" alt="" shrinktofit="true"> with picture<!--EndFragment--> </body> </html> That pastes perfectly into a new message. It doesn't paste into Notepad++, it pastes into LibreOffice with the image and into MS Office without the image. Further analysis: When copying this in TB 45.x, you get a flavour "Unicode Text Format" on the clipboard, which is what Notepad++ will paste. When using TB 52, there is no such flavour. Looks like we lost the "Unicode Text Format" flavour. Magnus, can you please take a look. Workaround: View the message as plain text if you want to copy to Notepad.
Blocks: 1315480, 1322155
Flags: needinfo?(mkmelin+mozilla)
Summary: Copy mail text → When copying HTML fragment containing text and embedded cid: image, no "text only" flavour is placed onto the clipboard (HTML flavour only) - Copying text and image doesn't paste text into Notepad
Status: UNCONFIRMED → NEW
Ever confirmed: true
When copying text and image from a web page, this problem doesn't occur. So the problem is caused by TB when converting the internal mailnews URL (mailbox:// or imap://) to a data: URL: https://hg.mozilla.org/comm-central/rev/c8666b9f31bc868950a698b2cc28896d45a09030#l1.81 I'll get this fixed right now.
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Flags: needinfo?(mkmelin+mozilla)
Attached patch 1354452-set-plain-flavour.patch (v1). (obsolete) (deleted) — Splinter Review
Magnus regressed this, but with 17 reviews in the queue he's not the best reviewer here I'm afraid.
Attachment #8855913 - Flags: review?(mkmelin+mozilla)
Attachment #8855913 - Flags: review?(acelists)
Comment on attachment 8855913 [details] [diff] [review] 1354452-set-plain-flavour.patch (v1). Review of attachment 8855913 [details] [diff] [review]: ----------------------------------------------------------------- Thx! r=mkmelin ::: mail/base/content/mailWindow.js @@ +126,5 @@ > } > > let html = div.innerHTML; > + let parserUtils = Cc["@mozilla.org/parserutils;1"] > + .getService(Components.interfaces.nsIParserUtils); Commponets.classes instead of Cc @@ +128,5 @@ > let html = div.innerHTML; > + let parserUtils = Cc["@mozilla.org/parserutils;1"] > + .getService(Components.interfaces.nsIParserUtils); > + let plain = parserUtils.convertToPlainText(html, > + Components.interfaces.nsIDocumentEncoder.OutputSelectionOnly, 0); OutputSelectionOnly looks wrong OutputForPlainTextClipboardCopy maybe?
Attachment #8855913 - Flags: review?(mkmelin+mozilla)
Attachment #8855913 - Flags: review?(acelists)
Attachment #8855913 - Flags: review+
Issued fixed.
Attachment #8855913 - Attachment is obsolete: true
Attachment #8855931 - Flags: review+
Sign, too fast, issues fixed.
https://hg.mozilla.org/comm-central/rev/b8c745f4d6b49198780f5ff79bb4c32ff5de599b BTW, I tested this with a 300KB e-mail with lots of images and text. Worked fine.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 55.0
Comment on attachment 8855931 [details] [diff] [review] 1354452-set-plain-flavour.patch (v2). [Approval Request Comment] Regression caused by (bug #): Bug 1315480. User impact if declined: No plain text flavour, so can't copy certain e-mails to a text editor. Testing completed (on c-c, etc.): Manual. Risk to taking this patch (and alternatives if risky): Not risky.
Attachment #8855931 - Flags: approval-comm-esr52?
Attachment #8855931 - Flags: approval-comm-beta+
Attachment #8855931 - Flags: approval-comm-aurora+
Attachment #8855931 - Flags: approval-comm-beta+
Attachment #8855931 - Flags: approval-comm-esr52? → approval-comm-esr52+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: