Issue 961751 in chromium: Extra newline added to text containing html tags inserted into a contentEditable element with display: inline-block

0 views
Skip to first unread message

brettd3000 via monorail

unread,
May 10, 2019, 12:33:39 PM5/10/19
to editi...@chromium.org
Status: Unconfirmed
Owner: ----
Labels: Arch-x86_64 Hotlist-Interop Via-Wizard-API
Components: Blink>Editing
OS: Windows
Pri: 2
Type: Bug

New issue 961751 by brett...@gmail.com: Extra newline added to text containing html tags inserted into a contentEditable element with display: inline-block
https://bugs.chromium.org/p/chromium/issues/detail?id=961751

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36

Steps to reproduce the problem:
The attached file automatically does all steps.
It also repeats the test on different element (all with the same text), only changing the element display and enclosing html tags around the inserted text.

1. Create a div element
2. Set the element contentEditable attribute to "true"
3. Set the element style to "display: inline-block"
4. Enter text into the element
5. Set text caret to somewhere inside the element, not at start or end.
6. Run JavaScript: "document.execCommand('insertHTML', false, '<b>NEW TEXT</b>')"
OR
6. Paste text into element (If the clipboard has similar text/html data in it)

What is the expected behavior?
New text is inserted, without affecting the whitespace around the inserted text

What went wrong?
New text and html tags are inserted, and an extra newline is added after the inserted text.

Did this work before? N/A

Does this work in other browsers? Yes

Chrome version: 74.0.3729.131 Channel: stable
OS Version: 10.0
Flash Version:

This happens both when pasting, or using "document.execCommand('insertHTML')".
It only happens when the contentEditable element is "display: inline-block", and the inserted text has html tags in it.
If the text caret is at the start or end of the element, then a newline is not added.
If there is text selected, then a newline is not added.

This works without issue in Firefox, no extra newline is added.

Attachments:
insertHTML-newline-test.html 1.2 KB

--
You received this message because:
1. A rule CC'd you on the issue
2. You are auto-CC'd on all issues in component Blink>Editing

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

Reply to this email to add a comment or make updates.

santhoshkumar via monorail

unread,
May 13, 2019, 4:00:46 AM5/13/19
to editi...@chromium.org
Updates:
Cc: santho...@chromium.org
Labels: M-76 Target-76 FoundIn-74 FoundIn-75 FoundIn-76 Triaged-ET Needs-Triage-M74 OS-Linux OS-Mac
Status: Untriaged

Comment #1 on issue 961751 by santho...@chromium.org: Extra newline added to text containing html tags inserted into a contentEditable element with display: inline-block
https://bugs.chromium.org/p/chromium/issues/detail?id=961751#c1

Able to reproduce the issue on reported chrome version #74.0.3729.131,Beta #75.0.3770.27,Dev#76.0.3788.1 and latest chrome canary #76.0.3793.0 using Mac 10.12 ,windows 10 and linux 17.10 by following steps as per comment#0.

The behaviour is seen from M-60. This is non regression issue hence marking it as untraiged and requesting some one from dev team to look into the issue.

Thanks..
Reply all
Reply to author
Forward
0 new messages