New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 654509 link

Starred by 5 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

Contenteditable: Undesirable transformations on copy/paste

Reported by aaron.na...@pearson.com, Oct 10 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36

Steps to reproduce the problem:
1. In a blank contenteditable, enter a blank line followed by a line with some text (ex "123456789")
2. Select All and copy
3. Paste twice and review HTML generated.

What is the expected behavior?
Before you copy/paste. the HTML will look like this:

<div><br></div><div>123456789</div>

After copying pasting twice on windows you would expect to get this:

<div><br></div><div>123456789</div><div><br></div><div>123456789</div>

What went wrong?
On Windows you end up with this: 

<br><div>123456789<br></div><div><br></div>123456789

Notice the first BR has been unwrapped as well as the last text element.

On Mac you end up with this: 

<br class="Apple-interchange-newline">123456789<br class="Apple-interchange-newline">123456789<br>

Notice the DIVs have been stripped altogether.

HTML generated from paste operation should be predictable.

Sample file used is attached.

Did this work before? N/A 

Chrome version: 53.0.2785.143  Channel: stable
OS Version: OS X 10.11.5
Flash Version: Shockwave Flash 23.0 r0

As noted this happens on Mac and Windows. I've tried it Canary on Windows and Mac the the results are the same in 53 and 56.0.2886.0 on each platform
 
index0.html
200 bytes View Download

Comment 1 by rsesek@chromium.org, Oct 11 2016

Components: Blink>Editing>Content
Labels: OS-Windows
Cc: kkaluri@chromium.org
Labels: M-55
Status: Untriaged (was: Unconfirmed)
Able to reproduce this issue on Windows-10 and Mac 10.12 using chrome latest stable M53-53.0.2785.143 and earlier version of chrome M30-30.0.1549.0. 
Observed the same html pattern in both versions in both OS platforms.

Please check the screenshot taken in M30-30.0.1549.0 which was taken in windows.

This is a non-regression issue and marking it as untriaged.

Issue-654509.png
7.1 KB View Download

Comment 3 by yosin@chromium.org, Oct 18 2016

Status: Available (was: Untriaged)
Clipboard contains following HTML after Copy:
<html>
<body>
<br class="Apple-interchange-newline">
<span style="color: rgb(0, 0, 0); font-family: Meiryo; font-size: medium; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;">123456789</span>
</body>
</html>

This is pasting behavior.

Comment 4 by meade@chromium.org, Feb 16 2017

Cc: sureshkumari@chromium.org
Issue 685839 has been merged into this issue.

Comment 5 by meade@chromium.org, Feb 16 2017

Duped bug has more examples.

Comment 6 by yosin@chromium.org, Oct 4 2017

Labels: Pri-3
Hello, any update on this?

Sign in to add a comment