Changeset 93858 in webkit
- Timestamp:
- Aug 26, 2011 1:59:01 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r93855 r93858 1 2011-08-26 Shinya Kawanaka <shinyak@google.com> 2 3 REGRESSION(r93390): Empty or invalid maxlength of an input tag should be ignored. 4 https://bugs.webkit.org/show_bug.cgi?id=67015 5 6 Reviewed by Kent Tamura. 7 8 * fast/forms/input-text-paste-maxlength-expected.txt: 9 Added maxlength="" and maxlength="invalid" tests. 10 * fast/forms/input-text-paste-maxlength.html: ditto. 11 * fast/forms/script-tests/textarea-maxlength.js: ditto. 12 * fast/forms/textarea-maxlength-expected.txt: ditto. 13 1 14 2011-08-25 Ben Wells <benwells@chromium.org> 2 15 -
trunk/LayoutTests/fast/forms/input-text-paste-maxlength-expected.txt
r93390 r93858 29 29 PASS domValueOf('l') is '' 30 30 PASS visibleValueOf('l') is '' 31 empty maxlength should be ignored. 32 PASS domValueOf('m') is '12' + fancyX + '45' 33 PASS visibleValueOf('m') is '12' + fancyX + '45' 34 invalid maxlength should be ignored. 35 PASS domValueOf('n') is '12' + fancyX + '45' 36 PASS visibleValueOf('n') is '12' + fancyX + '45' 31 37 PASS successfullyParsed is true 32 38 33 39 TEST COMPLETE 34 40 -
trunk/LayoutTests/fast/forms/input-text-paste-maxlength.html
r93390 r93858 19 19 <input type="text" id="k" size="5" maxlength="4"> 20 20 <input type="text" id="l" size="5" maxlength="0"> 21 <input type="text" id="m" size="5" maxlength=""> 22 <input type="text" id="n" size="5" maxlength="invalid"> 21 23 22 24 <script> … … 101 103 shouldBe("visibleValueOf('l')", "''"); 102 104 105 debug("empty maxlength should be ignored."); 106 document.getElementById("m").focus(); 107 document.execCommand("InsertHTML", false, "12x̲̅45"); 108 shouldBe("domValueOf('m')", "'12' + fancyX + '45'"); 109 shouldBe("visibleValueOf('m')", "'12' + fancyX + '45'"); 110 111 debug("invalid maxlength should be ignored."); 112 document.getElementById("n").focus(); 113 document.execCommand("InsertHTML", false, "12x̲̅45"); 114 shouldBe("domValueOf('n')", "'12' + fancyX + '45'"); 115 shouldBe("visibleValueOf('n')", "'12' + fancyX + '45'"); 116 103 117 var successfullyParsed = true; 104 118 </script> -
trunk/LayoutTests/fast/forms/script-tests/textarea-maxlength.js
r93390 r93858 141 141 shouldBe('textArea.value', '""'); 142 142 143 // In the case maxlength='' 144 createFocusedTextAreaWithMaxLength(''); 145 textArea.value = ''; 146 document.execCommand('insertText', false, 'ABC'); 147 shouldBe('textArea.value', '"ABC"'); 148 149 // In the case maxlength='invalid' 150 createFocusedTextAreaWithMaxLength('invalid'); 151 textArea.value = ''; 152 document.execCommand('insertText', false, 'ABC'); 153 shouldBe('textArea.value', '"ABC"'); 154 143 155 var successfullyParsed = true; -
trunk/LayoutTests/fast/forms/textarea-maxlength-expected.txt
r93390 r93858 31 31 PASS textArea.value is "ABC" 32 32 PASS textArea.value is "" 33 PASS textArea.value is "ABC" 34 PASS textArea.value is "ABC" 33 35 PASS successfullyParsed is true 34 36 -
trunk/Source/WebCore/ChangeLog
r93856 r93858 1 2011-08-26 Shinya Kawanaka <shinyak@google.com> 2 3 REGRESSION(r93390): Empty or invalid maxlength of an input tag should be ignored. 4 https://bugs.webkit.org/show_bug.cgi?id=67015 5 6 Reviewed by Kent Tamura. 7 8 * html/HTMLInputElement.cpp: 9 (WebCore::HTMLInputElement::parseMaxLengthAttribute): 10 Checks the validity of maxlength attribute when converting it to integer. 11 1 12 2011-08-25 Yuta Kitamura <yutak@chromium.org> 2 13 -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r93390 r93858 1922 1922 void HTMLInputElement::parseMaxLengthAttribute(Attribute* attribute) 1923 1923 { 1924 int maxLength = attribute->isNull() ? maximumLength : attribute->value().toInt(); 1924 int maxLength; 1925 if (!parseHTMLInteger(attribute->value(), maxLength)) 1926 maxLength = maximumLength; 1925 1927 if (maxLength < 0 || maxLength > maximumLength) 1926 1928 maxLength = maximumLength;
Note: See TracChangeset
for help on using the changeset viewer.