[webkit-changes] [WebKit/WebKit] 225289: Change the linebreak behavior of minlength and max...
Chris Dumez
noreply at github.com
Sun Feb 26 18:02:11 PST 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2252898e2468994720be25176170e00bc7b26ca3
https://github.com/WebKit/WebKit/commit/2252898e2468994720be25176170e00bc7b26ca3
Author: Chris Dumez <cdumez at apple.com>
Date: 2023-02-26 (Sun, 26 Feb 2023)
Changed paths:
M LayoutTests/fast/forms/textarea-maxlength-expected.txt
M LayoutTests/fast/forms/textarea-maxlength.html
M Source/WebCore/html/HTMLTextAreaElement.cpp
M Source/WebCore/html/HTMLTextAreaElement.h
Log Message:
-----------
Change the linebreak behavior of minlength and maxlength attributes of TEXTAREA
https://bugs.webkit.org/show_bug.cgi?id=249916
rdar://103856355
Reviewed by Darin Adler.
Align the linebreak behavior of minlength and maxlength attributes of TEXTAREA with
the specification, Blink and Gecko.
Old behavior:
CRLF, CR, or LF is counted as 2 because we limited the submission value.
New behavior:
CRLF, CR, or LF is counted as 1 because we limit the API value.
This is a cherry-pick of Blink:
https://chromium.googlesource.com/chromium/src.git/+/a15474ff7adff41a8956ab436ac63a7d5b7a090f%5E%21/#F3
* LayoutTests/fast/forms/textarea-maxlength-expected.txt:
* LayoutTests/fast/forms/textarea-maxlength.html:
* Source/WebCore/html/HTMLTextAreaElement.cpp:
(WebCore::computeLengthForAPIValue):
(WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent const):
(WebCore::HTMLTextAreaElement::sanitizeUserInputValue):
(WebCore::HTMLTextAreaElement::validationMessage const):
(WebCore::HTMLTextAreaElement::tooShort const):
(WebCore::HTMLTextAreaElement::tooLong const):
(WebCore::computeLengthForSubmission): Deleted.
(WebCore::numberOfLineBreaks): Deleted.
(WebCore::upperBoundForLengthForSubmission): Deleted.
* Source/WebCore/html/HTMLTextAreaElement.h:
Canonical link: https://commits.webkit.org/260861@main
More information about the webkit-changes
mailing list