Title: [96290] trunk
Revision
96290
Author
[email protected]
Date
2011-09-28 19:49:45 -0700 (Wed, 28 Sep 2011)

Log Message

REGRESSION(r93858): Can't type anything into input elements when maxlength is greater than 2^31
https://bugs.webkit.org/show_bug.cgi?id=68981

Reviewed by Darin Adler.

Source/WebCore:

* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseHTMLInteger):
Check the failure of charactersToIntStrict().
(WebCore::parseHTMLNonNegativeInteger):
Check the failure of charactersToUIntStrict().

LayoutTests:

* fast/forms/input-text-paste-maxlength-expected.txt:
* fast/forms/input-text-paste-maxlength.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (96289 => 96290)


--- trunk/LayoutTests/ChangeLog	2011-09-29 02:37:33 UTC (rev 96289)
+++ trunk/LayoutTests/ChangeLog	2011-09-29 02:49:45 UTC (rev 96290)
@@ -1,3 +1,13 @@
+2011-09-28  Kent Tamura  <[email protected]>
+
+        REGRESSION(r93858): Can't type anything into input elements when maxlength is greater than 2^31
+        https://bugs.webkit.org/show_bug.cgi?id=68981
+
+        Reviewed by Darin Adler.
+
+        * fast/forms/input-text-paste-maxlength-expected.txt:
+        * fast/forms/input-text-paste-maxlength.html:
+
 2011-09-28  Ryosuke Niwa  <[email protected]>
 
         One last GTK rebaseline for r96257.

Modified: trunk/LayoutTests/fast/forms/input-text-paste-maxlength-expected.txt (96289 => 96290)


--- trunk/LayoutTests/fast/forms/input-text-paste-maxlength-expected.txt	2011-09-29 02:37:33 UTC (rev 96289)
+++ trunk/LayoutTests/fast/forms/input-text-paste-maxlength-expected.txt	2011-09-29 02:49:45 UTC (rev 96290)
@@ -34,7 +34,9 @@
 invalid maxlength should be ignored.
 PASS domValueOf('n') is '12' + fancyX + '45'
 PASS visibleValueOf('n') is '12' + fancyX + '45'
+PASS domValueOf('huge') is '12' + fancyX + '45'
+PASS visibleValueOf('huge') is '12' + fancyX + '45'
 PASS successfullyParsed is true
 
 TEST COMPLETE
-           
+

Modified: trunk/LayoutTests/fast/forms/input-text-paste-maxlength.html (96289 => 96290)


--- trunk/LayoutTests/fast/forms/input-text-paste-maxlength.html	2011-09-29 02:37:33 UTC (rev 96289)
+++ trunk/LayoutTests/fast/forms/input-text-paste-maxlength.html	2011-09-29 02:49:45 UTC (rev 96290)
@@ -8,6 +8,7 @@
 <p id="description"></p>
 <div id="console"></div>
 
+<div id=container>
 <input type="text" id="f" size="5" maxlength="4">
 <input type="text" id="e" size="5" maxlength="4">
 <input type="text" id="d" size="5">
@@ -20,6 +21,8 @@
 <input type="text" id="l" size="5" maxlength="0">
 <input type="text" id="m" size="5" maxlength="">
 <input type="text" id="n" size="5" maxlength="invalid">
+<input type="text" id="huge" size="5" maxlength="9999999999">
+</div>
 
 <script>
 function domValueOf(id) {
@@ -113,7 +116,12 @@
 document.execCommand("InsertHTML", false, "12x&#x305;&#x332;45");
 shouldBe("domValueOf('n')", "'12' + fancyX + '45'");
 shouldBe("visibleValueOf('n')", "'12' + fancyX + '45'");
+document.getElementById("huge").focus();
+document.execCommand("InsertHTML", false, "12x&#x305;&#x332;45");
+shouldBe("domValueOf('huge')", "'12' + fancyX + '45'");
+shouldBe("visibleValueOf('huge')", "'12' + fancyX + '45'");
 
+document.getElementById('container').innerHTML = '';
 var successfullyParsed = true;
 </script>
 <script src=""

Modified: trunk/Source/WebCore/ChangeLog (96289 => 96290)


--- trunk/Source/WebCore/ChangeLog	2011-09-29 02:37:33 UTC (rev 96289)
+++ trunk/Source/WebCore/ChangeLog	2011-09-29 02:49:45 UTC (rev 96290)
@@ -1,3 +1,16 @@
+2011-09-28  Kent Tamura  <[email protected]>
+
+        REGRESSION(r93858): Can't type anything into input elements when maxlength is greater than 2^31
+        https://bugs.webkit.org/show_bug.cgi?id=68981
+
+        Reviewed by Darin Adler.
+
+        * html/parser/HTMLParserIdioms.cpp:
+        (WebCore::parseHTMLInteger):
+        Check the failure of charactersToIntStrict().
+        (WebCore::parseHTMLNonNegativeInteger):
+        Check the failure of charactersToUIntStrict().
+
 2011-09-28  Antoine Labour  <[email protected]>
 
         Remove unused createRootLayerPainter from CCLayerTreeHostClient

Modified: trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp (96289 => 96290)


--- trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp	2011-09-29 02:37:33 UTC (rev 96289)
+++ trunk/Source/WebCore/html/parser/HTMLParserIdioms.cpp	2011-09-29 02:49:45 UTC (rev 96290)
@@ -215,8 +215,9 @@
     }
 
     // Step 9
-    value = sign * charactersToIntStrict(digits.characters(), digits.length());
-    return true;
+    bool ok;
+    value = sign * charactersToIntStrict(digits.characters(), digits.length(), &ok);
+    return ok;
 }
 
 // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-non-negative-integers
@@ -261,8 +262,9 @@
     }
 
     // Step 9
-    value = charactersToUIntStrict(digits.characters(), digits.length());
-    return true;
+    bool ok;
+    value = charactersToUIntStrict(digits.characters(), digits.length(), &ok);
+    return ok;
 }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to