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

Issue 791194 link

Starred by 1 user

Issue metadata

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



Sign in to add a comment

<textarea> placeholder doesn't line break on explicit U+000D CARRIAGE RETURN (CR)

Reported by ambassad...@gmail.com, Dec 2 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0

Steps to reproduce the problem:
1. Set the placeholder of a textarea to a value including \r via JS/Include &#xd; in the source of a textarea placeholder
2. Observe that they aren't rendered as line breaks in the placeholder

What is the expected behavior?
textarea placeholders should render CRs as line breaks in all instances.

What went wrong?
When the HTML source for a placeholder includes explicit CRs via entities, or when a placeholder is set via JS containing \r, line breaks aren't rendered.

Did this work before? No 

Does this work in other browsers? No
 There are three scenarios to test: CR in the source, CR as an entity (&#xd;) in the source, and setting a value via JS with a CR as \r in the string.
Chrome line breaks on all three in textarea content, but only on CR in the source for the placeholder.

Firefox is currently worse since it doesn't support newlines in textarea placeholders at all, but that is in the process of being fixed, and it was while doing so and writing web platform tests for it that this behaviour came to light.  It line breaks for all three scenarios in textarea content.
https://bugzilla.mozilla.org/show_bug.cgi?id=1391044

Edge does the same as Chrome for placeholders, but extends that behaviour to the content of the textarea as well (only CR in source), so is at least the most consistent of the three between placeholder and content, but the worst in terms of the spec.

Chrome version: 62.0.3202.94 (Official Build) Built on Ubuntu , running on Ubuntu 17.04 (64-bit)  Channel: n/a
OS Version: 
Flash Version: 

https://html.spec.whatwg.org/multipage/form-elements.html#attr-textarea-placeholder
"All U+000D CARRIAGE RETURN U+000A LINE FEED character pairs (CRLF) in the hint, as well as all other U+000D CARRIAGE RETURN (CR) and U+000A LINE FEED (LF) characters in the hint, must be treated as line breaks when rendering the hint.
 
ta-ph-cr.html
856 bytes View Download
Cc: sc00335...@techmahindra.com
Labels: Needs-Triage-M62 Triaged-ET M-65 OS-Mac OS-Windows
Status: Untriaged (was: Unconfirmed)
Able to reproduce this issue on reported version 62.0.3202.94 and on latest canary 65.0.3285.0 using html file attached in comment#0.

Same behaviour is seen from M50. Hence considering this issue as Non-Regression and marking as Untriaged.

Thanks!

Comment 2 by kochi@chromium.org, Dec 27 2017

Components: -Blink>Forms Blink>Editing
Can editing team triage this?

Comment 3 by yosin@chromium.org, Jan 9 2018

Components: -Blink>Editing Blink>Forms>Textarea
Status: Available (was: Untriaged)
For simplicity, should we convert sole CR to LF when setting placeholder?
Project Member

Comment 4 by sheriffbot@chromium.org, Jan 10

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
Labels: -Hotlist-Recharge-Cold -M-65 -Needs-Triage-M62 Hotlist-GoodFirstBug
Status: Available (was: Untriaged)

Sign in to add a comment