REGRESSION(r164329): Input fields are not honoring the maxlength attribute
https://bugs.webkit.org/show_bug.cgi?id=139447
Reviewed by Benjamin Poulain.
Source/WebCore:
The bug was caused by String::substring being called with the selection's end offset
in the second argument instead of the selection's length in handleBeforeTextInsertedEvent.
Fixed the bug by passing the right second argument to String::substring.
Test: fast/forms/input-maxlength-inserting-in-middle.html
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
LayoutTests:
Added regression tests.
* fast/forms/input-maxlength-inserting-in-middle-expected.txt: Added.
* fast/forms/input-maxlength-inserting-in-middle.html: Added.
* fast/forms/input-maxlength-paste-clusters-in-middle-expected.txt: Added.
* fast/forms/input-maxlength-paste-clusters-in-middle.html: Added.
* fast/forms/input-maxlength-paste-in-middle-expected.txt: Added.
* fast/forms/input-maxlength-paste-in-middle.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177098
268f45cc-cd09-0410-ab3c-
d52691b4dbfc