Title: [96671] branches/chromium/874
Revision
96671
Author
[email protected]
Date
2011-10-04 18:32:18 -0700 (Tue, 04 Oct 2011)

Log Message

Merge 96290 - 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:


[email protected]
BUG=crbug.com/98117
Review URL: http://codereview.chromium.org/8135023

Modified Paths

Diff

Modified: branches/chromium/874/LayoutTests/fast/forms/input-text-paste-maxlength-expected.txt (96670 => 96671)


--- branches/chromium/874/LayoutTests/fast/forms/input-text-paste-maxlength-expected.txt	2011-10-05 01:14:40 UTC (rev 96670)
+++ branches/chromium/874/LayoutTests/fast/forms/input-text-paste-maxlength-expected.txt	2011-10-05 01:32:18 UTC (rev 96671)
@@ -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: branches/chromium/874/LayoutTests/fast/forms/input-text-paste-maxlength.html (96670 => 96671)


--- branches/chromium/874/LayoutTests/fast/forms/input-text-paste-maxlength.html	2011-10-05 01:14:40 UTC (rev 96670)
+++ branches/chromium/874/LayoutTests/fast/forms/input-text-paste-maxlength.html	2011-10-05 01:32:18 UTC (rev 96671)
@@ -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: branches/chromium/874/Source/WebCore/html/parser/HTMLParserIdioms.cpp (96670 => 96671)


--- branches/chromium/874/Source/WebCore/html/parser/HTMLParserIdioms.cpp	2011-10-05 01:14:40 UTC (rev 96670)
+++ branches/chromium/874/Source/WebCore/html/parser/HTMLParserIdioms.cpp	2011-10-05 01:32:18 UTC (rev 96671)
@@ -215,8 +215,9 @@
     }
 
     // Step 9
-    value = sign * charactersToIntStrict(digits.data(), digits.size());
-    return true;
+    bool ok;
+    value = sign * charactersToIntStrict(digits.data(), digits.size(), &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.data(), digits.size());
-    return true;
+    bool ok;
+    value = charactersToUIntStrict(digits.data(), digits.size(), &ok);
+    return ok;
 }
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to