Copy highlighted text to clipboard ignores non-inlined CSS styling when pasting as rich text (to HTML editors, MS Word, Excel, Outlook etc.)

NEW
Unassigned

Status

()

11 years ago
3 months ago

People

(Reporter: duncan.loveday, Unassigned)

Tracking

({parity-chrome, testcase})

Trunk
parity-chrome, testcase
Points:
---
Bug Flags:
webcompat ?

Firefox Tracking Flags

(platform-rel -)

Details

(Whiteboard: [platform-rel-Microsoft][platform-rel-Outlook][webcompat])

Attachments

(2 attachments)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b2pre) Gecko/2007112705 Minefield/3.0b2pre
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b2pre) Gecko/2007112705 Minefield/3.0b2pre

On a windows platform, highlighting a portion of an HTML document and copying it to the clipboard preserves explicit HTML styling and inline CSS styling but ignores references to internal and external stylesheets. IE7 preserves both inline and out of line styles.

Reproducible: Always

Steps to Reproduce:
1. Open the attached HTML test case.
2. Right click->Select all then ctrl-C to copy to clipboard.
3. Paste the result into Microsoft Word
Actual Results:  
HTML and inline styling (the first two rows of the table) are preserved. Internal and External stylesheet references (the last two rows of the table) are lost.

Expected Results:  
Ideally all styling would be preserved.

FWIW, Opera doesn't preserve styling at all.
(Reporter)

Comment 1

11 years ago
Created attachment 291138 [details]
External Stylesheet
(Reporter)

Comment 2

11 years ago
Created attachment 291139 [details]
HTML test case
(Reporter)

Updated

11 years ago
Keywords: testcase

Comment 3

11 years ago
Confirming.
There is similar Bug 116083 but it's focused on <pre> tag so I'm not duplicating to it.

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b2pre) Gecko/2007120505 Minefield/3.0b2pre ID:2007120505
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 4

4 years ago
This was wontfixed per bug 189320 comment 2, but it may be needs to be reconsidered, as Chrome does this (by inserting the computed style inline in the copied elements).
OS: Windows XP → All
Hardware: x86 → All
Summary: Copy highlighted text to clipboard ignores non-inlined CSS styling → Copy highlighted text to clipboard ignores non-inlined CSS styling when pasting as rich text (to HTML editors, MS Word, Excel, Outlook etc.)
Whiteboard: [parity-chrome]
Version: unspecified → Trunk

Comment 5

4 years ago
To test without MS Word you can open this data URL:

data:text/html,<div contenteditable>Text

then focus the div and paste.

Updated

4 years ago
Duplicate of this bug: 617479

Updated

4 years ago
Duplicate of this bug: 890468

Updated

4 years ago
Duplicate of this bug: 247971

Updated

4 years ago
Duplicate of this bug: 449333

Updated

4 years ago
Duplicate of this bug: 973576

Comment 11

4 years ago
Firefox 37.0.2 no longer copies even the inline styles. I'm not sure whether this merits opening a new bug or not. Operating system: MacOS X Yosemite. Safari and Chrome copy rich text properly.
Whiteboard: [parity-chrome] → [parity-chrome][platform-rel-Microsoft][platform-rel-Outlook]

Updated

2 years ago
platform-rel: --- → ?

Comment 12

2 years ago
I wouldn't say it's related to Microsoft or Outlook. The reason I added myself to the bug is that on Mac OS, when I try to copy from Firefox to a native Mac application that supports rich text (not a Microsoft application), the styling is not kept, while copying from Chrome/Safari keeps the styling. And it used to work in Firefox in the past.
platform-rel: ? → -
Mass bug change to replace various 'parity' whiteboard flags with the new canonical keywords. (See bug 1443764 comment 13.)
Keywords: parity-chrome
Whiteboard: [parity-chrome][platform-rel-Microsoft][platform-rel-Outlook] → [platform-rel-Microsoft][platform-rel-Outlook]
This was also reported on webcompat.com for LinkedIn copy-pasting.
Flags: webcompat?
Whiteboard: [platform-rel-Microsoft][platform-rel-Outlook] → [platform-rel-Microsoft][platform-rel-Outlook][webcompat]
You need to log in before you can comment on or make changes to this bug.