Intent to implement and ship: Update <textarea maxlength/minlength> behavior for linebreaks

72 views
Skip to first unread message

TAMURA, Kent

unread,
Sep 16, 2016, 9:21:07 AM9/16/16
to blink-dev
tk...@google.com https://html.spec.whatwg.org/multipage/forms.html#maximum-allowed-value-length Update <textarea maxlength> behavior for linebreaks

A single linebreak in a <textarea> will be counted as 1 for maxlength / minlength validation. It is counted as 2 for now.

The specification was updated by https://github.com/whatwg/html/commit/163703186794c21daa92cc2718218afa44f26071. Before the change, maxlength and minlength limit |value| length, not |API value| length. In <textarea>, a single linebreak is represented as CR LF in |value|, and LF in |API value|. Firefox and Edge incorrectly applied to |API value|, and WebKit and Blink correctly applied to |value|. But the specification is changed to follow Firefox and Edge.
Improve interoperability.
Resolve inconsistency between textarea.value.length and maxlength/minlength validation. Firefox: Shipped Edge: Shipped Safari: No public signals Web developers: Mixed signals
Low.
After the change, Blink will allow more characters in <textarea maxlength>. The new behavior is same as Firefox and Edge. So the risk must be low.
None.
Yes. No OWP launch bug.  A normal bug: http://crbug.com/624361 https://www.chromestatus.com/features/5653898178068480
Yes.



--
TAMURA Kent
Software Engineer, Google


PhistucK

unread,
Sep 16, 2016, 9:58:16 AM9/16/16
to TAMURA, Kent, blink-dev
No public signals from Safari? Ryosuke Niwa from Apple participated in the discussions...


PhistucK

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

TAMURA, Kent

unread,
Sep 19, 2016, 9:30:26 AM9/19/16
to blink-dev

TAMURA, Kent

unread,
Sep 19, 2016, 9:33:49 AM9/19/16
to PhistucK, blink-dev
The discussion is here:

AFAIK, rniwa didn't made any comment about linebreak counting.

Domenic Denicola

unread,
Sep 19, 2016, 9:39:33 AM9/19/16
to TAMURA, Kent, PhistucK, Ryosuke Niwa, blink-dev
From: tk...@google.com [mailto:tk...@google.com] On Behalf Of TAMURA, Kent

> The discussion is here:
> https://github.com/whatwg/html/issues/1467
>
> AFAIK, rniwa didn't made any comment about linebreak counting.

Rniwa should feel free to speak for himself, but in https://github.com/whatwg/html/pull/1712#issuecomment-242281206 he spoke in favor.

Philip Jägenstedt

unread,
Sep 22, 2016, 6:03:32 AM9/22/16
to Domenic Denicola, TAMURA, Kent, PhistucK, Ryosuke Niwa, blink-dev
LGTM1

Are there tests in web-platform-tests for this? That would increase the chances that it's fixed in WebKit as well, I think.

TAMURA, Kent

unread,
Sep 22, 2016, 8:48:23 PM9/22/16
to Philip Jägenstedt, Domenic Denicola, PhistucK, Ryosuke Niwa, blink-dev
Unfortunately we can't make automated tests for minlength / maxlength behavior in web-platform-tests.  They always need user-edit.

Philip Jägenstedt

unread,
Sep 23, 2016, 5:35:35 AM9/23/16
to TAMURA, Kent, Domenic Denicola, PhistucK, Ryosuke Niwa, blink-dev
How about manual tests? Those can at least in principle be automated using the wpt_automation trick that Pointer Events and UI Events tests are using, and I'm trying to copy for Fullscreen. Although that wouldn't show up as a failure in WebKit, so maybe just filing a bug is better.

None of that blocks this intent, of course.

Dimitri

unread,
Sep 27, 2016, 12:15:18 PM9/27/16
to blink-dev, tk...@chromium.org, d...@domenic.me, phis...@gmail.com, rn...@apple.com
LGTM2

Chris Harrelson

unread,
Sep 27, 2016, 12:45:39 PM9/27/16
to Dimitri, blink-dev, Kent Tamura, Domenic Denicola, PhistucK Productions, rn...@apple.com
LGTM3

On Tue, Sep 27, 2016 at 9:15 AM, Dimitri <dgla...@chromium.org> wrote:
LGTM2
Reply all
Reply to author
Forward
0 new messages