REGRESSION(r164329): Input fields are not honoring the maxlength attribute
[WebKit-https.git] / Source / WebCore / ChangeLog
index 329d9b5af5bbbbe2c5b4b0fa39d0a2dc64048459..8d9e3e3b0c3bfe46eec97f11a8830b84f14656f9 100644 (file)
@@ -1,3 +1,20 @@
+2014-12-10  Ryosuke Niwa  <rniwa@webkit.org>
+
+        REGRESSION(r164329): Input fields are not honoring the maxlength attribute
+        https://bugs.webkit.org/show_bug.cgi?id=139447
+
+        Reviewed by Benjamin Poulain.
+
+        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):
+
 2014-12-10  Anders Carlsson  <andersca@apple.com>
 
         Add a missing null check.