New issue
Advanced search Search tips

Issue 731310 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

inconsistent treatment of trailing whitespace in contenteditable

Project Member Reported by skobes@chromium.org, Jun 8 2017

Issue description

Trailing space characters in an editable text node are sometimes ignored (as normal for HTML) and sometimes rendered (as if in CSS "white-space: pre").

Repro:

1. Go to: https://output.jsbin.com/qepatof
2. Click in the red box to focus it.
3. Move cursor to end of the text by holding right arrow key.
4. Type "x" once.

Expected result:
The last word in the box should be "xxxx".

Actual result:
The "x" is a word by itself.

The green boxes have what I believe is the correct behavior.  Note that all three boxes have the same DOM content; only their sizes are different.  The whitespace interpretation depends on the line wrapping, which is very weird.

Setting "line-break: normal" on the div corrects the problem.  This implicates the "-webkit-line-break: after-white-space" style that is added in HTMLElement::CollectStyleForPresentationAttribute.  See also issue 427135 which aims to remove this.

Discovered while looking at editing/inserting/typing-at-end-of-line.html.  There shouldn't be two spaces before "have", but there have been since http://crrev.com/9638d384.
 

Comment 1 by yosin@chromium.org, Jun 9 2017

Cc: -yoichio@chromium.org -xiaoche...@chromium.org -yosin@chromium.org
Components: -Blink>Editing Blink>Editing>Command
Status: Available (was: Unconfirmed)
Thanks for providing reproduce cases.
We need to have summarize related to whitespace handling.
Project Member

Comment 2 by sheriffbot@chromium.org, Jun 11 2018

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

Comment 3 by yosin@chromium.org, Jun 13 2018

Status: Available (was: Untriaged)

Comment 4 by yosin@chromium.org, Jun 13 2018

Status: Fixed (was: Available)
I could not reproduce with M67 with #c1.
It seems this issue is fixed.

Comment 5 by skobes@chromium.org, Jun 13 2018

Status: Available (was: Fixed)
This still repros for me in M67 Mac + Linux as well as Mac canary (69.0.3457.0).
whitespace.png
69.7 KB View Download

Sign in to add a comment