Changeset 86650 in webkit
- Timestamp:
- May 16, 2011 7:34:25 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r86649 r86650 1 2011-05-16 Naoki Takano <takano.naoki@gmail.com> 2 3 Reviewed by Kent Tamura. 4 5 HTML5 Number Spinbox displays a 0 in situations where a 0 is not between the min and max. 6 https://bugs.webkit.org/show_bug.cgi?id=60871 7 8 * fast/forms/input-stepup-stepdown-from-renderer-expected.txt: Added expected results. 9 * fast/forms/script-tests/input-stepup-stepdown-from-renderer.js: Added test patterns when initial values are empty. 10 1 11 2011-05-16 Adam Barth <abarth@webkit.org> 2 12 -
trunk/LayoutTests/fast/forms/input-stepup-stepdown-from-renderer-expected.txt
r72884 r86650 145 145 PASS stepUpExplicitBounds("4", "9", "0.005", "5.005", 11) is "5.06" 146 146 PASS stepUpExplicitBounds("4", "9", "0.005", "5.005", 12) is "5.065" 147 PASS stepUpExplicitBounds(-4, 4, 1, "") is "1" 148 PASS stepDownExplicitBounds(-4, 4, 1, "") is "-1" 149 PASS stepDownExplicitBounds(0, 4, 1, "") is "0" 150 PASS stepUpExplicitBounds(-4, 0, 1, "") is "0" 151 PASS stepDownExplicitBounds(1, 4, 1, "") is "1" 152 PASS stepUpExplicitBounds(1, 4, 1, "") is "1" 153 PASS stepDownExplicitBounds(-4, -1, 1, "") is "-1" 154 PASS stepUpExplicitBounds(-4, -1, 1, "") is "-1" 155 PASS stepUpExplicitBounds(-100, null, 3, "") is "2" 156 PASS stepDownExplicitBounds(-100, null, 3, "") is "-1" 157 PASS stepUpExplicitBounds(1, 4, 1, 0) is "1" 158 PASS stepDownExplicitBounds(1, 4, 1, 0) is "0" 159 PASS stepDownExplicitBounds(-4, -1, 1, 0) is "-1" 160 PASS stepUpExplicitBounds(-4, -1, 1, 0) is "0" 161 PASS stepUpExplicitBounds(-100, null, 3, 3) is "5" 162 PASS stepDownExplicitBounds(-100, null, 3, 3) is "2" 147 163 148 164 Range type -
trunk/LayoutTests/fast/forms/script-tests/input-stepup-stepdown-from-renderer.js
r72884 r86650 228 228 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 11)', '"5.06"'); 229 229 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 12)', '"5.065"'); 230 shouldBe('stepUpExplicitBounds(-4, 4, 1, "")', '"1"'); 231 shouldBe('stepDownExplicitBounds(-4, 4, 1, "")', '"-1"'); 232 shouldBe('stepDownExplicitBounds(0, 4, 1, "")', '"0"'); 233 shouldBe('stepUpExplicitBounds(-4, 0, 1, "")', '"0"'); 234 shouldBe('stepDownExplicitBounds(1, 4, 1, "")', '"1"'); 235 shouldBe('stepUpExplicitBounds(1, 4, 1, "")', '"1"'); 236 shouldBe('stepDownExplicitBounds(-4, -1, 1, "")', '"-1"'); 237 shouldBe('stepUpExplicitBounds(-4, -1, 1, "")', '"-1"'); 238 shouldBe('stepUpExplicitBounds(-100, null, 3, "")', '"2"'); 239 shouldBe('stepDownExplicitBounds(-100, null, 3, "")', '"-1"'); 240 shouldBe('stepUpExplicitBounds(1, 4, 1, 0)', '"1"'); 241 shouldBe('stepDownExplicitBounds(1, 4, 1, 0)', '"0"'); 242 shouldBe('stepDownExplicitBounds(-4, -1, 1, 0)', '"-1"'); 243 shouldBe('stepUpExplicitBounds(-4, -1, 1, 0)', '"0"'); 244 shouldBe('stepUpExplicitBounds(-100, null, 3, 3)', '"5"'); 245 shouldBe('stepDownExplicitBounds(-100, null, 3, 3)', '"2"'); 230 246 231 247 debug(''); -
trunk/Source/WebCore/ChangeLog
r86649 r86650 1 2011-05-16 Naoki Takano <takano.naoki@gmail.com> 2 3 Reviewed by Kent Tamura. 4 5 HTML5 Number Spinbox displays a 0 in situations where a 0 is not between the min and max. 6 https://bugs.webkit.org/show_bug.cgi?id=60871 7 8 Test: fast/forms/input-stepup-stepdown-from-renderer.html 9 10 In number input type, if the value is not a number, including empty, the currect valued is assumed 0. 11 But we have to handle it separately from the case when the value is actuall "0". 12 13 * html/HTMLInputElement.cpp: 14 (WebCore::HTMLInputElement::stepUpFromRenderer): Added cliping for default value. 15 1 16 2011-05-16 Adam Barth <abarth@webkit.org> 2 17 -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r85998 r86650 1462 1462 ExceptionCode ec; 1463 1463 current = m_inputType->defaultValueForStepUp(); 1464 int nextDiff = step * n; 1465 if (current < m_inputType->minimum() - nextDiff) 1466 current = m_inputType->minimum() - nextDiff; 1467 if (current > m_inputType->maximum() - nextDiff) 1468 current = m_inputType->maximum() - nextDiff; 1464 1469 setValueAsNumber(current, ec); 1465 1470 } … … 1468 1473 else { 1469 1474 ExceptionCode ec; 1470 if (stepMismatch( currentStringValue)) {1475 if (stepMismatch(value())) { 1471 1476 ASSERT(step); 1472 1477 double newValue;
Note: See TracChangeset
for help on using the changeset viewer.