Open
Bug 406488
Opened 17 years ago
Updated 2 years ago
Copy highlighted text to clipboard ignores non-inlined CSS styling when pasting as rich text (to HTML editors, MS Word, Excel, Outlook etc.)
Categories
(Core :: DOM: Serializers, defect)
Core
DOM: Serializers
Tracking
()
People
(Reporter: duncan.loveday, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: parity-chrome, testcase, Whiteboard: [platform-rel-Microsoft][platform-rel-Outlook][webcompat])
Attachments
(2 files)
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•17 years ago
|
||
Reporter | ||
Comment 2•17 years ago
|
||
Comment 3•17 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•10 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•10 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.
Comment 11•10 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.
Updated•8 years ago
|
Whiteboard: [parity-chrome] → [parity-chrome][platform-rel-Microsoft][platform-rel-Outlook]
Updated•8 years ago
|
platform-rel: --- → ?
Comment 12•8 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.
Updated•8 years ago
|
platform-rel: ? → -
Comment 13•7 years ago
|
||
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]
Comment 14•6 years ago
|
||
This was also reported on webcompat.com for LinkedIn copy-pasting.
See Also: → https://webcompat.com/issues/16508
Updated•6 years ago
|
Flags: webcompat?
Whiteboard: [platform-rel-Microsoft][platform-rel-Outlook] → [platform-rel-Microsoft][platform-rel-Outlook][webcompat]
Comment 15•6 years ago
|
||
Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.
Webcompat Priority: --- → ?
Comment 16•6 years ago
|
||
See bug 1547409. Migrating whiteboard priority tags to program flags.
Comment 17•4 years ago
|
||
Kagami, should this block blink-editor-compat?
Webcompat Priority: ? → P3
Flags: needinfo?(krosylight)
It seems Chrome adds inline style="background-color: blue"
but only when pasting across apps. cc'ing Mirko who have recently done some copy-paste work, as I'm not quite familiar with clipboard things.
Flags: needinfo?(krosylight) → needinfo?(mbrodesser)
Updated•4 years ago
|
Flags: needinfo?(mbrodesser)
Comment 19•4 years ago
•
|
||
Chrome also adds inline style
when copy-pasting within the browser (e.g. to data:text/html,<div contentEditable="true">X</div>
). Firefox doesn't.
So this should also block "blink-editor-compat".
Blocks: editor-blink-compat
Comment 20•4 years ago
|
||
Chrome inlines each element's style a lot. If we do similar things, cannot we apply same style smarter? (I don't have any concrete idea though.)
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•