New issue
Advanced search Search tips

Issue 670932 link

Starred by 3 users

Issue metadata

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



Sign in to add a comment

document.execCommand "insertText" can't paste text including '\r\n' string:

Reported by samoylen...@gmail.com, Dec 3 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36

Steps to reproduce the problem:
1. Open in chrome html page attached [chromeIssue.html] (there is 
- span element with [contenteditable] attribute and [white-space: pre-wrap;] css style)
- button "insert text"
2. Click the button (onclick event of the button subscribed to the function which inserts into the span the text with windows line breaks['\r\n'] using document.execCommand function.)

What is the expected behavior?
The 6 lines of text appears in the span element

What went wrong?
The text appears in the span element with extra empty lines after 3, 4, 5 and 6th lines of the text.

Did this work before? N/A 

Chrome version: 54.0.2840.99  Channel: stable
OS Version: 6.3
Flash Version: Shockwave Flash 23.0 r0

The bug reproduced for contenteditable elements with the [white-space: pre-wrap;] css style.
Reproduced if element is empty or if the cursor at the end of the text in the element.
 
chromeIssue.html
614 bytes View Download
Components: -Blink Blink>Editing

Comment 2 by ajha@chromium.org, Dec 5 2016

Labels: M-54
Labels: -Type-Bug -Pri-2 hasbisect OS-Linux OS-Mac Pri-1 Type-Bug-Regression
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on Windows 10, Mac 10.12.1 and Ubuntu 14.04 using chrome reported version #54.0.2840.99  and latest canary #57.0.2942.0.

Bisect Information:
=====================
Good build: 44.0.2359.0  Revision(324003)
Bad Build : 44.0.2360.0  Revision(324194)

Change Log URL: 

https://chromium.googlesource.com/chromium/src/+log/de446058f8bb18cdae0ef9395b76ac0d1c1b8f26..d6aece7c6748553aa11b9dbacd27b5ec4d2d363c

Blink Change Log:
https://chromium.googlesource.com/chromium/blink/+log/0cdfa90..f36d5e0

Unable to find any suspect from the above blink change log.

Could anyone from the dev team please help us in assigning it to the right owner.

Thanks...!!
Labels: -M-54 M-57
Labels: -Pri-1 Hotlist-Interop Pri-2
Status: Available (was: Untriaged)
Summary: document.execCommand "insertText" can't paste text including '\r\n' string: (was: document.execCommand "insertText" into contenteditable element adds extra new lines)
I found more serious issue: execCommand can't paste text including '\r\n' string:

<span id="edit" contenteditable="true"></span>
<script>
	var elem = document.getElementById('edit');
	elem.focus();
	document.execCommand("insertText", false, "foo\r\nbar");
</script>

Expected:
foo
bar

Actual;
foo

Edge, FF works well.

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

Labels: Pri-3
Components: Blink>Editing>Command
Project Member

Comment 8 by sheriffbot@chromium.org, Nov 14

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Status: Available (was: Untriaged)

Sign in to add a comment