Open
Bug 1342725
Opened 8 years ago
Updated 2 years ago
"Paste Without Formatting" should strip image style (for example margin-top)
Categories
(Core :: DOM: Editor, enhancement, P3)
Core
DOM: Editor
Tracking
()
NEW
People
(Reporter: leyyyyy, Unassigned)
Details
Attachments
(1 file)
574.52 KB,
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:51.0) Gecko/20100101 Firefox/51.0
Build ID: 20170125094131
Steps to reproduce:
Open Thunderbird...
In Thunderbird create new message.
Open Firefox...
Open any small image (half of your screen) in FF.
Right click on image and choose Copy image.
Paste image from clipboard to new message.
Actual results:
Image pasted with significant indent.
Expected results:
Image should be in correct place.. like it is when image inserted from file system.
Comment 1•8 years ago
|
||
Where exactly did you copy the image from? Which website/page?
I have tested it a bit more.
I think it happens only when you on specific site.
For example I can reproduce it with google images.
Open this link:
https://www.google.by/search?q=Cooler+Master+CM+Storm+Trooper+(SGC-5000-KKN1)&client=firefox-b-ab&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiknpSu1q7SAhXCCCwKHQNNCCcQ_AUICSgC&biw=2560&bih=1339&gws_rd=cr&ei=O0WzWIKvCaHU6AT-pKfQDA#imgrc=yxzeqGLTdeIDhM:
And copy image opened in the center of screen.
Comment 3•8 years ago
|
||
Thanks.
When copying that image I get this HTML (use add-on ThunderHTMLedit to inspect the HTML of the message):
<img class="irc_mi"
src="http://www.conrad.com/medias/global/ce/8000_8999/8700/8710/8710/871060_RB_00_FB.EPS_250.jpg"
alt="Image result for Cooler Master CM Storm Trooper
(SGC-5000-KKN1)" style="margin-top: 127px;" width="250"
height="250">
See the margin-top? That gets copied as well and causes the undesired space.
Sadly there is nothing we can do about this.
What you can do is this: In Firefox, instead of "Copy Image", you use "Copy Image Location", and in Thunderbird you use "Insert > Image" and paste the image location into the box provided.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
Why you cannot just paste content?
How it happens in Outlook, Word, Skype, Photoshop and other programs.
I do not think it is good idea to paste HTML.
But if you have to consider HTML styles because you use it in some way to copy items with formatting.
Then why I cannot use menu item "Paste without Formatting"?
It simply do not work... Allow this menu item to paste images with ignoring of any formatting.
Comment 5•8 years ago
|
||
You need to understand how copy/paste works. The "sending" application, in this case the web browser Firefox populates the clipboard with various so-called flavours. In case of copying an image from a web page, FF places raw image (bitmap) and HTML flavours onto the clipboards.
The "receiving" application, Thunderbird, selects one of those available flavours and inserts it. It prefers HTML over bitmap.
We had the discussion elsewhere whether the HTML should be post-processed and some attributes stripped, but that is hard and therefore has gone nowhere (bug 1276391).
To solve your immediate problem, simply drag the image instead of using copy/paste. Dragged content will always be transferred as bitmap.
Thanks for explanation..
I know how clipboard works. At least on Windows...
I am software developer...
So I will try to explain what I mentioned.
I told that described behavior with images is exactly what user can expect.
What happens with text if it is formatted in MS Word and copied from it to Notepad or to another Word document with "Paste special / Paste without formatting" option? Right.. Only text will be pasted (because notepad does not support other content and in MS Word we have selected specific option).
So I suggested to fix "Paste Without Formatting" in Thunderbird functionality to use raw bitmap data.
So common Paste can work as it is now trying to paste image as html content. But when we have raw image in clipboard and do not have raw text then we should paste raw image.
All is pretty easy...
P.S. I have solved my personal issue some days ago... I am talking only about the way how UX can be improved.
> But when we have raw image in clipboard and do not have raw text then we should paste raw image.
I mean in case of "Paste Without Formatting"
Comment 8•8 years ago
|
||
OK, let's reopen this as enhancement. "Paste Without Formatting" in handled in Core::Editor, see NS_REGISTER_ONE_COMMAND(nsPasteNoFormattingCommand, "cmd_pasteNoFormatting");
Severity: normal → enhancement
Status: RESOLVED → REOPENED
Component: Untriaged → Editor
Ever confirmed: true
Product: Thunderbird → Core
Resolution: INVALID → ---
Summary: Inserted image has wrong place → "Paste Without Formatting" should strip image style (for example margin-top)
Version: 45 Branch → Trunk
Updated•8 years ago
|
Status: REOPENED → NEW
Updated•8 years ago
|
Priority: -- → P3
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•