HTML textarea accepts \r character, when it should be replaced with \n
Categories
(Core :: DOM: Editor, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr68 | --- | unaffected |
firefox70 | --- | unaffected |
firefox71 | --- | unaffected |
firefox72 | + | fixed |
People
(Reporter: darktrojan, Assigned: masayuki)
References
(Regression)
Details
(Keywords: regression)
Attachments
(2 files)
2.14 KB,
patch
|
Details | Diff | Splinter Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
When keyboard events fire "\r" at a textarea, the value could include the \r
, when they should instead have a \n
. Or at least, that's what I understand is supposed to happen.
Test case coming up.
Reporter | ||
Comment 1•5 years ago
|
||
This is a copy of dom/tests/mochitest/keyhandling/test_textarea.html modified to show the error, and moved somewhere so that it runs on Linux.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
I cannot reproduce this bug with usual DOM operation and \r
inputting key event is never fired if the source is native key event because ASCII control characters are replaced with normal characters which are inputted without modifier key. So that this is an edge case.
Comment 3•5 years ago
|
||
[Tracking Requested - why for this release]: I'm actually not sure we need to track. That is, it's not clear to me whether the web can encounter this behavior, per comment 2....
Assignee | ||
Comment 4•5 years ago
|
||
Well, anyway, a patch is coming.
Assignee | ||
Comment 5•5 years ago
|
||
Starting from bug 1597679, HTMLTextAreaElement::GetValueInternal()
stops
converting \r\n
and \r
with \n
because it may be in hot path and the scan
cost of \r
in nsContentUtils::PlatformToDOMLineBreaks()
is redundant in
most cases.
However, there are still some paths to input \r
. This patch makes them
call nsContentUtils::PlatformToDOMLineBreaks()
if they have not done it.
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/51ba531b4ad5 `TextEditor` shouldn't put `\r` into its anonymous text node r=m_kato
Comment 7•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Updated•2 years ago
|
Description
•