New issue
Advanced search Search tips

Issue 595491 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Can't enter leading/trailing spaces in TEXTAREA with white-space:normal or nowrap

Project Member Reported by tkent@chromium.org, Mar 16 2016

Issue description

Version: 51+
OS: All

What steps will reproduce the problem?
(1) Open the following URL:
    data:text/html;charset=utf-8,<textarea style="white-space:nowrap" autofocus>
(2) Type "a" space "b"

What is the expected output? What do you see instead?
Expected: "a b" is shown.
Actual: "ab" is shown.

TEXTAREA value is alos "ab" unexpectedly.

Please use labels and text to provide additional information.
This is a regression since 51 canary.

 

Comment 1 by tkent@chromium.org, Mar 17 2016

It seems Firefox has a special handling for the last whitespace. However, we can't put the caret between continuous two spaces.

I discussed this with the Editing team, and we concluded plain-text editing with collapsed spaces (white-space:normal/nowrap/pre-line) didn't make sense. We should interpret some white-space values differently in plain-text editing:

   Specified -> Actual behavior in plain-text editing
    normal   -> pre-wrap
    nowrap   -> pre
    pre-line -> pre-wrap

Probably this is Edge's behavior.

Comment 2 by yosin@chromium.org, Mar 17 2016

Note: applying CSS style properties in form controls is implementation details and it is NOT interoperable[1].

To make customize TEXTAREA, we need to use "appearance:none" and hook keyboard event and mouse event to implement editing feature. However, it requires lots of work, Blink should provide more primitive to make implementing customer TEXTAREA easier.


[1] https://drafts.csswg.org/css-ui-4/#form-styling

Comment 3 by tkent@chromium.org, Mar 17 2016

Cc: tkent@chromium.org
 Issue 595505  has been merged into this issue.

Comment 4 by tkent@chromium.org, Mar 17 2016

Status: Started (was: Assigned)
Project Member

Comment 5 by bugdroid1@chromium.org, Mar 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/73a59b847f8b048bf26d7806bafa403c8f3f95d6

commit 73a59b847f8b048bf26d7806bafa403c8f3f95d6
Author: tkent <tkent@chromium.org>
Date: Thu Mar 17 07:49:12 2016

Don't collapse whitespace in contenteditable=plaintext-only.

Rewrite white-space property for contenteditable=plaintext-only elements as:
    normal   -> pre-wrap
    nowrap   -> pre
    pre-line -> pre-wrap
because whitespace collapsing doesn't make sense in plain-text editing.
The new behavior matches to Microsoft Edge for TEXTAREA.

BUG= 595491 

Review URL: https://codereview.chromium.org/1813663002

Cr-Commit-Position: refs/heads/master@{#381668}

[modify] https://crrev.com/73a59b847f8b048bf26d7806bafa403c8f3f95d6/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/73a59b847f8b048bf26d7806bafa403c8f3f95d6/third_party/WebKit/LayoutTests/accessibility/is-richly-editable-expected.txt
[add] https://crrev.com/73a59b847f8b048bf26d7806bafa403c8f3f95d6/third_party/WebKit/LayoutTests/editing/input/textarea-white-space-normal-trailing-space-expected.html
[add] https://crrev.com/73a59b847f8b048bf26d7806bafa403c8f3f95d6/third_party/WebKit/LayoutTests/editing/input/textarea-white-space-normal-trailing-space.html
[modify] https://crrev.com/73a59b847f8b048bf26d7806bafa403c8f3f95d6/third_party/WebKit/LayoutTests/fast/css-grid-layout/stale-grid-layout-2-expected.txt
[modify] https://crrev.com/73a59b847f8b048bf26d7806bafa403c8f3f95d6/third_party/WebKit/LayoutTests/platform/mac/editing/pasteboard/8145-1-expected.png
[modify] https://crrev.com/73a59b847f8b048bf26d7806bafa403c8f3f95d6/third_party/WebKit/LayoutTests/platform/mac/editing/pasteboard/8145-1-expected.txt
[modify] https://crrev.com/73a59b847f8b048bf26d7806bafa403c8f3f95d6/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/basic-textareas-expected.png
[modify] https://crrev.com/73a59b847f8b048bf26d7806bafa403c8f3f95d6/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/basic-textareas-expected.txt
[modify] https://crrev.com/73a59b847f8b048bf26d7806bafa403c8f3f95d6/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
[modify] https://crrev.com/73a59b847f8b048bf26d7806bafa403c8f3f95d6/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.h
[modify] https://crrev.com/73a59b847f8b048bf26d7806bafa403c8f3f95d6/third_party/WebKit/Source/core/html/shadow/TextControlInnerElements.cpp

Comment 6 by tkent@chromium.org, Mar 17 2016

Cc: -tkent@chromium.org
Labels: M-51
Status: Fixed (was: Started)
Project Member

Comment 7 by bugdroid1@chromium.org, Mar 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6822f0065149ca5a1fba8e903203df481e356457

commit 6822f0065149ca5a1fba8e903203df481e356457
Author: Rebaseline Bot <blink-rebaseline-bot@chromium.org>
Date: Thu Mar 17 10:50:33 2016

Auto-rebaseline for r381668

https://chromium.googlesource.com/chromium/src/+/73a59b847

BUG= 595491 
TBR=tkent@chromium.org

Review URL: https://codereview.chromium.org/1807783004 .

Cr-Commit-Position: refs/heads/master@{#381689}

[modify] https://crrev.com/6822f0065149ca5a1fba8e903203df481e356457/third_party/WebKit/LayoutTests/TestExpectations
[add] https://crrev.com/6822f0065149ca5a1fba8e903203df481e356457/third_party/WebKit/LayoutTests/platform/android/editing/pasteboard/8145-1-expected.png
[add] https://crrev.com/6822f0065149ca5a1fba8e903203df481e356457/third_party/WebKit/LayoutTests/platform/android/editing/pasteboard/8145-1-expected.txt
[modify] https://crrev.com/6822f0065149ca5a1fba8e903203df481e356457/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/8145-1-expected.png
[modify] https://crrev.com/6822f0065149ca5a1fba8e903203df481e356457/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/8145-1-expected.txt
[modify] https://crrev.com/6822f0065149ca5a1fba8e903203df481e356457/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/basic-textareas-expected.txt
[modify] https://crrev.com/6822f0065149ca5a1fba8e903203df481e356457/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/basic-textareas-expected.png
[modify] https://crrev.com/6822f0065149ca5a1fba8e903203df481e356457/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/basic-textareas-expected.txt
[modify] https://crrev.com/6822f0065149ca5a1fba8e903203df481e356457/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/basic-textareas-expected.png
[modify] https://crrev.com/6822f0065149ca5a1fba8e903203df481e356457/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/basic-textareas-expected.txt
[modify] https://crrev.com/6822f0065149ca5a1fba8e903203df481e356457/third_party/WebKit/LayoutTests/platform/win/editing/pasteboard/8145-1-expected.png
[modify] https://crrev.com/6822f0065149ca5a1fba8e903203df481e356457/third_party/WebKit/LayoutTests/platform/win/editing/pasteboard/8145-1-expected.txt
[modify] https://crrev.com/6822f0065149ca5a1fba8e903203df481e356457/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/basic-textareas-expected.txt

Comment 8 by tkent@chromium.org, Mar 18 2016

Cc: yosin@chromium.org
 Issue 595954  has been merged into this issue.

Sign in to add a comment