Changeset 92746 in webkit
- Timestamp:
- Aug 9, 2011 9:43:59 PM (13 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 1 added
- 3 deleted
- 13 edited
- 14 copied
- 6 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r92744 r92746 1 2011-08-09 Kent Tamura <tkent@chromium.org> 2 3 Move <input type=time> tests to fast/forms/time/ 4 https://bugs.webkit.org/show_bug.cgi?id=65955 5 6 Reviewed by Hajime Morita. 7 8 * fast/forms/ValidityState-rangeOverflow-expected.txt: Removed 'time' part. 9 * fast/forms/ValidityState-rangeUnderflow-expected.txt: ditto. 10 * fast/forms/ValidityState-stepMismatch-expected.txt: ditto. 11 * fast/forms/ValidityState-typeMismatch-time-expected.txt: Removed. 12 * fast/forms/ValidityState-typeMismatch-time.html: Removed. 13 * fast/forms/input-stepup-stepdown-expected.txt: Removed 'time' part. 14 * fast/forms/input-stepup-stepdown-from-renderer-expected.txt: ditto. 15 * fast/forms/input-type-change3-expected.txt: ditto. 16 * fast/forms/input-valueasdate-time-expected.txt: Removed. 17 * fast/forms/input-valueasdate-time.html: Removed. 18 * fast/forms/input-valueasnumber-time-expected.txt: Removed. 19 * fast/forms/input-valueasnumber-time.html: Removed. 20 * fast/forms/script-tests/ValidityState-rangeOverflow.js: Removed 'time' part. 21 * fast/forms/script-tests/ValidityState-rangeUnderflow.js: ditto. 22 * fast/forms/script-tests/ValidityState-stepMismatch.js: ditto. 23 * fast/forms/script-tests/ValidityState-typeMismatch-time.js: Removed. 24 * fast/forms/script-tests/input-stepup-stepdown-from-renderer.js: Removed 'time' part. 25 * fast/forms/script-tests/input-stepup-stepdown.js: ditto. 26 * fast/forms/script-tests/input-type-change3.js: ditto. 27 * fast/forms/script-tests/input-valueasdate-time.js: Removed. 28 * fast/forms/script-tests/input-valueasnumber-time.js: Removed. 29 * fast/forms/time: Added. 30 * fast/forms/time/ValidityState-rangeOverflow-time-expected.txt: Copied from LayoutTests/fast/forms/ValidityState-rangeOverflow-expected.txt. 31 * fast/forms/time/ValidityState-rangeOverflow-time.html: Copied from LayoutTests/fast/forms/script-tests/ValidityState-rangeOverflow.js. 32 * fast/forms/time/ValidityState-rangeUnderflow-time-expected.txt: Copied from LayoutTests/fast/forms/ValidityState-rangeUnderflow-expected.txt. 33 * fast/forms/time/ValidityState-rangeUnderflow-time.html: Copied from LayoutTests/fast/forms/script-tests/ValidityState-rangeUnderflow.js. 34 * fast/forms/time/ValidityState-stepMismatch-time-expected.txt: Copied from LayoutTests/fast/forms/ValidityState-stepMismatch-expected.txt. 35 * fast/forms/time/ValidityState-stepMismatch-time.html: Copied from LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js. 36 * fast/forms/time/ValidityState-typeMismatch-time-expected.txt: Copied from LayoutTests/fast/forms/ValidityState-typeMismatch-time-expected.txt. 37 * fast/forms/time/ValidityState-typeMismatch-time.html: Copied from LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-time.js. 38 * fast/forms/time/input-valueasdate-time-expected.txt: Copied from LayoutTests/fast/forms/input-valueasdate-time-expected.txt. 39 * fast/forms/time/input-valueasdate-time.html: Copied from LayoutTests/fast/forms/script-tests/input-valueasdate-time.js. 40 * fast/forms/time/input-valueasnumber-time-expected.txt: Copied from LayoutTests/fast/forms/input-valueasnumber-time-expected.txt. 41 * fast/forms/time/input-valueasnumber-time.html: Copied from LayoutTests/fast/forms/script-tests/input-valueasnumber-time.js. 42 * fast/forms/time/time-input-type-expected.txt: Copied from LayoutTests/fast/forms/week/week-input-type-expected.txt. 43 * fast/forms/time/time-input-type.html: Copied from LayoutTests/fast/forms/week/week-input-type.html. 44 * fast/forms/time/time-input-visible-string-expected.txt: Copied from LayoutTests/fast/forms/week/week-input-visible-string-expected.txt. 45 * fast/forms/time/time-input-visible-string.html: Copied from LayoutTests/fast/forms/week/week-input-visible-string.html. 46 * fast/forms/time/time-stepup-stepdown-expected.txt: Copied from LayoutTests/fast/forms/input-stepup-stepdown-expected.txt. 47 * fast/forms/time/time-stepup-stepdown-from-renderer-expected.txt: Copied from LayoutTests/fast/forms/input-stepup-stepdown-from-renderer-expected.txt. 48 * fast/forms/time/time-stepup-stepdown-from-renderer.html: Copied from LayoutTests/fast/forms/script-tests/input-stepup-stepdown-from-renderer.js. 49 * fast/forms/time/time-stepup-stepdown.html: Copied from LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js. 50 1 51 2011-08-09 Abhishek Arya <inferno@chromium.org> 2 52 -
trunk/LayoutTests/fast/forms/ValidityState-rangeOverflow-expected.txt
r92728 r92746 64 64 PASS The value "101" overflows the maximum value "100". 65 65 PASS The value "101" doesn't overflow the maximum value "1E+2" when disabled. 66 67 Type=time68 PASS The value "13:16" doesn't overflow the maximum value "".69 PASS The value "13:16" doesn't overflow the maximum value "".70 PASS The value "13:16" doesn't overflow the maximum value "foo".71 PASS The value "13:16" doesn't overflow the maximum value "13:16".72 PASS The value "13:16" doesn't overflow the maximum value "13:17".73 PASS The value "13:16" doesn't overflow the maximum value "14:15".74 PASS The value "foo" doesn't overflow the maximum value "13:16".75 PASS The value "13:16" overflows the maximum value "13:15".76 PASS The value "23:59:59.999" overflows the maximum value "13:16".77 PASS The value "13:16" overflows the maximum value "12:00".78 PASS The value "23:59:59.999" doesn't overflow the maximum value "13:16" when disabled.79 66 PASS successfullyParsed is true 80 67 -
trunk/LayoutTests/fast/forms/ValidityState-rangeUnderflow-expected.txt
r92728 r92746 64 64 PASS The value "101" undeflows the minimum value "200". 65 65 PASS The value "99" doesn't underflow the minimum value "1E+2" when disabled. 66 67 Type=time68 PASS The value "13:16" doesn't underflow the minimum value "".69 PASS The value "13:16" doesn't underflow the minimum value "".70 PASS The value "13:16" doesn't underflow the minimum value "foo".71 PASS The value "00:00:00.000" doesn't underflow the minimum value "".72 PASS The value "23:59:59.999" doesn't underflow the minimum value "".73 PASS The value "13:16" doesn't underflow the minimum value "11:00".74 PASS The value "13:16" doesn't underflow the minimum value "13:16".75 PASS The value "foo" doesn't underflow the minimum value "11:00".76 PASS The value "13:16" undeflows the minimum value "13:17".77 PASS The value "23:59" undeflows the minimum value "23:59:30".78 PASS The value "13:16" undeflows the minimum value "14:00".79 PASS The value "23:59" doesn't underflow the minimum value "23:59:30" when disabled.80 66 PASS successfullyParsed is true 81 67 -
trunk/LayoutTests/fast/forms/ValidityState-stepMismatch-expected.txt
r92728 r92746 1 Check stepMismatch results for type=date, datetime, datetime-local , time.1 Check stepMismatch results for type=date, datetime, datetime-local. 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". … … 155 155 PASS stepMismatchFor("1", "2", "0", true) is false 156 156 157 Time type158 Empty values159 PASS stepMismatchFor("", null, null) is false160 PASS stepMismatchFor("", "2", "12:34:56") is false161 Normal step values162 PASS stepMismatchFor("12:34:55", "1", "12:34:56") is false163 PASS stepMismatchFor("12:34:55.001", "1", "12:34:56") is true164 PASS stepMismatchFor("12:34:56.001", "0.001", "12:34:56") is false165 PASS stepMismatchFor("12:34:55", "0.333", "12:34:56") is true166 PASS stepMismatchFor("12:34:55.001", "0.333", "12:34:56") is false167 PASS stepMismatchFor("12:34", "86400", "12:34") is false168 PASS stepMismatchFor("23:59:59.998", "86399.999", "00:00") is true169 PASS stepMismatchFor("23:59:59.999", "86399.999", "00:00") is false170 Implicit step base171 PASS stepMismatchFor("12:34", "120", null) is false172 PASS stepMismatchFor("12:35", "120", null) is true173 Small step values174 PASS stepMismatchFor("12:34:55.001", "0.0003", "12:34.55.000") is false175 PASS stepMismatchFor("12:34:55.001", "0.0019", "12:34.55.000") is true176 PASS stepMismatchFor("12:34:55.004", "0.0019", "12:34.55.000") is false177 Invalid or no step values178 PASS stepMismatchFor("12:34", null, "12:34") is false179 PASS stepMismatchFor("12:34:56", null, "12:34") is true180 PASS stepMismatchFor("12:34", "-1", "12:34") is false181 PASS stepMismatchFor("12:34", "foo", "12:34") is false182 Special step value183 PASS stepMismatchFor("12:35", "any", "12:34") is false184 Disabled185 PASS stepMismatchFor("12:34:55.001", "1", "12:34:56", true) is false186 187 157 Unsupported types 188 158 PASS input.type = "text"; input.step = "3"; input.min = ""; input.value = "2"; input.validity.stepMismatch is false -
trunk/LayoutTests/fast/forms/input-stepup-stepdown-expected.txt
r92728 r92746 1 Check stepUp() and stepDown() bahevior for type=date, datetime, datetime-local , time.1 Check stepUp() and stepDown() bahevior for type=date, datetime, datetime-local. 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". … … 220 220 PASS stepDownExplicitBounds(null, null, 0.1, 1) is "0.9" 221 221 222 Time type223 Invalid value224 PASS stepUp("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.225 PASS stepDown("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.226 Non-number arguments227 PASS stepUp("20:13", null, null, "0") is "20:13"228 PASS stepDown("20:13", null, null, "0") is "20:13"229 PASS stepUp("20:13", null, null, "foo") is "20:13"230 PASS stepDown("20:13", null, null, "foo") is "20:13"231 PASS stepUp("20:13", null, null, null) is "20:13"232 PASS stepDown("20:13", null, null, null) is "20:13"233 Normal cases234 PASS stepUp("20:13", null, null) is "20:14"235 PASS stepDown("20:13", null, null) is "20:12"236 PASS stepUp("20:13", null, null, 10) is "20:23"237 PASS stepDown("20:13", null, null, 11) is "20:02"238 PASS stepUp("20:13", "4", null, 2) is "20:13:08"239 PASS stepDown("20:13", "4", null, 3) is "20:12:48"240 Step=any241 PASS stepUp("20:13", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.242 PASS stepDown("20:13", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.243 Overflow/underflow244 PASS stepUp("20:13", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.245 PASS stepDown("20:13", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.246 PASS stepUp("20:13", "1", "20:13") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.247 PASS stepDown("20:13", "1", "20:13") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.248 PASS stepUp("23:59", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.249 PASS stepDown("00:00", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.250 251 222 Unsupported type 252 223 PASS input.step = "3"; input.min = ""; input.max = ""; input.value = "2"; input.stepDown() threw exception Error: INVALID_STATE_ERR: DOM Exception 11. -
trunk/LayoutTests/fast/forms/input-stepup-stepdown-from-renderer-expected.txt
r92728 r92746 1 Check stepping-up and -down for from renderer. No cases of empty initial values for type=date, datetime, datetime-local , time.1 Check stepping-up and -down for from renderer. No cases of empty initial values for type=date, datetime, datetime-local. 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". … … 206 206 PASS stepDownExplicitBounds(null, null, 0.1, 1) is "0.9" 207 207 208 Time type209 Function arguments are (value, step, {min or max}, [stepCount]).210 Normal cases211 PASS stepUp("20:13", null, null) is "20:14"212 PASS stepDown("20:13", null, null) is "20:12"213 PASS stepUp("20:13", null, null, 10) is "20:23"214 PASS stepDown("20:13", null, null, 11) is "20:02"215 PASS stepUp("20:13", "4", null, 2) is "20:13:08"216 PASS stepDown("20:13", "4", null, 3) is "20:12:48"217 Step=any218 PASS stepUp("20:13", "any", null) is "20:14"219 PASS stepDown("20:13", "any", null) is "20:12"220 Overflow/underflow221 PASS stepUp("20:13", "3.40282346e+38", null) is "23:59:59.999"222 PASS stepDown("20:13", "3.40282346e+38", null) is "00:00:00.000"223 PASS stepUp("20:13", "1", "20:13") is "20:13"224 PASS stepDown("20:13", "1", "20:13") is "20:13"225 PASS stepUp("23:59", null, null) is "23:59"226 PASS stepDown("00:00", null, null) is "00:00"227 stepDown()/stepUp() for stepMismatch values228 PASS stepDown("20:13", "3", "20:12:56") is "20:12:59"229 PASS stepUp("00:13", "7", "") is "00:13:04"230 231 208 PASS successfullyParsed is true 232 209 -
trunk/LayoutTests/fast/forms/input-type-change3-expected.txt
r92728 r92746 35 35 PASS input.type for "tel" is correctly "tel". 36 36 PASS input.type for "telephone" is correctly "text". 37 PASS input.type for "time" is correctly "time".38 37 PASS input.type for "url" is correctly "url". 39 38 PASS input.type for "uri" is correctly "text". -
trunk/LayoutTests/fast/forms/script-tests/ValidityState-rangeOverflow.js
r92728 r92746 136 136 checkNotOverflow('101', '1E+2', true); 137 137 138 // ----------------------------------------------------------------139 debug('');140 debug('Type=time');141 input.type = 'time';142 input.min = '';143 // No overflow cases144 checkNotOverflow('13:16', null);145 checkNotOverflow('13:16', '');146 checkNotOverflow('13:16', 'foo');147 checkNotOverflow('13:16', '13:16');148 checkNotOverflow('13:16', '13:17');149 checkNotOverflow('13:16', '14:15');150 checkNotOverflow('foo', '13:16');151 152 // Overflow cases153 checkOverflow('13:16', '13:15');154 checkOverflow('23:59:59.999', '13:16');155 input.min = '14:00'; // value < min && value > max156 checkOverflow('13:16', '12:00');157 158 // Disabled159 checkNotOverflow('23:59:59.999', '13:16', true);160 161 138 var successfullyParsed = true; -
trunk/LayoutTests/fast/forms/script-tests/ValidityState-rangeUnderflow.js
r92728 r92746 144 144 checkNotUnderflow('99', '1E+2', true); 145 145 146 // ----------------------------------------------------------------147 debug('');148 debug('Type=time');149 input.type = 'time';150 input.max = '';151 // No underflow cases152 checkNotUnderflow('13:16', null);153 checkNotUnderflow('13:16', '');154 checkNotUnderflow('13:16', 'foo');155 checkNotUnderflow('00:00:00.000', '');156 checkNotUnderflow('23:59:59.999', '');157 checkNotUnderflow('13:16', '11:00');158 checkNotUnderflow('13:16', '13:16');159 checkNotUnderflow('foo', '11:00');160 161 // Underflow cases162 checkUnderflow('13:16', '13:17');163 checkUnderflow('23:59', '23:59:30');164 input.max = '11:00'; // value < min && value > max165 checkUnderflow('13:16', '14:00');166 167 // Disabled168 checkNotUnderflow('23:59', '23:59:30', true);169 170 146 var successfullyParsed = true; -
trunk/LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js
r92728 r92746 1 description('Check stepMismatch results for type=date, datetime, datetime-local , time.');1 description('Check stepMismatch results for type=date, datetime, datetime-local.'); 2 2 3 3 var input = document.createElement('input'); … … 177 177 178 178 debug(''); 179 debug('Time type');180 input.type = 'time';181 debug('Empty values');182 shouldBeFalse('stepMismatchFor("", null, null)');183 shouldBeFalse('stepMismatchFor("", "2", "12:34:56")');184 debug('Normal step values');185 shouldBeFalse('stepMismatchFor("12:34:55", "1", "12:34:56")');186 shouldBeTrue('stepMismatchFor("12:34:55.001", "1", "12:34:56")');187 shouldBeFalse('stepMismatchFor("12:34:56.001", "0.001", "12:34:56")');188 shouldBeTrue('stepMismatchFor("12:34:55", "0.333", "12:34:56")');189 shouldBeFalse('stepMismatchFor("12:34:55.001", "0.333", "12:34:56")');190 shouldBeFalse('stepMismatchFor("12:34", "86400", "12:34")');191 shouldBeTrue('stepMismatchFor("23:59:59.998", "86399.999", "00:00")');192 shouldBeFalse('stepMismatchFor("23:59:59.999", "86399.999", "00:00")');193 debug('Implicit step base');194 shouldBeFalse('stepMismatchFor("12:34", "120", null)');195 shouldBeTrue('stepMismatchFor("12:35", "120", null)');196 debug('Small step values');197 shouldBeFalse('stepMismatchFor("12:34:55.001", "0.0003", "12:34.55.000")');198 shouldBeTrue('stepMismatchFor("12:34:55.001", "0.0019", "12:34.55.000")');199 shouldBeFalse('stepMismatchFor("12:34:55.004", "0.0019", "12:34.55.000")');200 debug('Invalid or no step values');201 shouldBeFalse('stepMismatchFor("12:34", null, "12:34")');202 shouldBeTrue('stepMismatchFor("12:34:56", null, "12:34")');203 shouldBeFalse('stepMismatchFor("12:34", "-1", "12:34")');204 shouldBeFalse('stepMismatchFor("12:34", "foo", "12:34")');205 debug('Special step value');206 shouldBeFalse('stepMismatchFor("12:35", "any", "12:34")');207 debug('Disabled');208 shouldBeFalse('stepMismatchFor("12:34:55.001", "1", "12:34:56", true)');209 210 debug('');211 179 debug('Unsupported types'); 212 180 shouldBe('input.type = "text"; input.step = "3"; input.min = ""; input.value = "2"; input.validity.stepMismatch', 'false'); -
trunk/LayoutTests/fast/forms/script-tests/input-stepup-stepdown-from-renderer.js
r92728 r92746 1 description('Check stepping-up and -down for <input> from renderer. No cases of empty initial values for type=date, datetime, datetime-local , time.');1 description('Check stepping-up and -down for <input> from renderer. No cases of empty initial values for type=date, datetime, datetime-local.'); 2 2 3 3 var input = document.createElement('input'); … … 290 290 291 291 debug(''); 292 debug('Time type');293 input.type = 'time';294 debug('Function arguments are (value, step, {min or max}, [stepCount]).');295 debug('Normal cases');296 shouldBe('stepUp("20:13", null, null)', '"20:14"');297 shouldBe('stepDown("20:13", null, null)', '"20:12"');298 shouldBe('stepUp("20:13", null, null, 10)', '"20:23"');299 shouldBe('stepDown("20:13", null, null, 11)', '"20:02"');300 shouldBe('stepUp("20:13", "4", null, 2)', '"20:13:08"');301 shouldBe('stepDown("20:13", "4", null, 3)', '"20:12:48"');302 debug('Step=any');303 shouldBe('stepUp("20:13", "any", null)', '"20:14"');304 shouldBe('stepDown("20:13", "any", null)', '"20:12"');305 debug('Overflow/underflow');306 shouldBe('stepUp("20:13", "3.40282346e+38", null)', '"23:59:59.999"');307 shouldBe('stepDown("20:13", "3.40282346e+38", null)', '"00:00:00.000"');308 shouldBe('stepUp("20:13", "1", "20:13")', '"20:13"');309 shouldBe('stepDown("20:13", "1", "20:13")', '"20:13"');310 shouldBe('stepUp("23:59", null, null)', '"23:59"');311 shouldBe('stepDown("00:00", null, null)', '"00:00"');312 debug('stepDown()/stepUp() for stepMismatch values');313 shouldBe('stepDown("20:13", "3", "20:12:56")', '"20:12:59"');314 shouldBe('stepUp("00:13", "7", "")', '"00:13:04"');315 316 debug('');317 292 var successfullyParsed = true; -
trunk/LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js
r92728 r92746 1 description('Check stepUp() and stepDown() bahevior for type=date, datetime, datetime-local , time.');1 description('Check stepUp() and stepDown() bahevior for type=date, datetime, datetime-local.'); 2 2 3 3 var input = document.createElement('input'); … … 276 276 277 277 debug(''); 278 debug('Time type');279 input.type = 'time';280 debug('Invalid value');281 shouldThrow('stepUp("", null, null)', invalidStateErr);282 shouldThrow('stepDown("", null, null)', invalidStateErr);283 debug('Non-number arguments');284 shouldBe('stepUp("20:13", null, null, "0")', '"20:13"');285 shouldBe('stepDown("20:13", null, null, "0")', '"20:13"');286 shouldBe('stepUp("20:13", null, null, "foo")', '"20:13"');287 shouldBe('stepDown("20:13", null, null, "foo")', '"20:13"');288 shouldBe('stepUp("20:13", null, null, null)', '"20:13"');289 shouldBe('stepDown("20:13", null, null, null)', '"20:13"');290 debug('Normal cases');291 shouldBe('stepUp("20:13", null, null)', '"20:14"');292 shouldBe('stepDown("20:13", null, null)', '"20:12"');293 shouldBe('stepUp("20:13", null, null, 10)', '"20:23"');294 shouldBe('stepDown("20:13", null, null, 11)', '"20:02"');295 shouldBe('stepUp("20:13", "4", null, 2)', '"20:13:08"');296 shouldBe('stepDown("20:13", "4", null, 3)', '"20:12:48"');297 debug('Step=any');298 shouldThrow('stepUp("20:13", "any", null)', invalidStateErr);299 shouldThrow('stepDown("20:13", "any", null)', invalidStateErr);300 debug('Overflow/underflow');301 shouldThrow('stepUp("20:13", "3.40282346e+38", null)', invalidStateErr);302 shouldThrow('stepDown("20:13", "3.40282346e+38", null)', invalidStateErr);303 shouldThrow('stepUp("20:13", "1", "20:13")', invalidStateErr);304 shouldThrow('stepDown("20:13", "1", "20:13")', invalidStateErr);305 shouldThrow('stepUp("23:59", null, null)', invalidStateErr);306 shouldThrow('stepDown("00:00", null, null)', invalidStateErr);307 308 debug('');309 278 debug('Unsupported type'); 279 input.type = 'text'; 310 280 shouldThrow('input.step = "3"; input.min = ""; input.max = ""; input.value = "2"; input.stepDown()', '"Error: INVALID_STATE_ERR: DOM Exception 11"'); 311 281 shouldThrow('input.stepDown(0)', '"Error: INVALID_STATE_ERR: DOM Exception 11"'); -
trunk/LayoutTests/fast/forms/script-tests/input-type-change3.js
r92728 r92746 49 49 check("tel", "tel"); 50 50 check("telephone", "text"); 51 check("time", "time");52 51 check("url", "url"); 53 52 check("uri", "text"); -
trunk/LayoutTests/fast/forms/time/ValidityState-rangeOverflow-time-expected.txt
r92745 r92746 1 This test aims to check for rangeOverflow flag with input fields1 This test aims to check for rangeOverflow flag with time input fields 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 Type=text7 PASS The value "101" doesn't overflow the maximum value "100".8 9 Type=date10 PASS The value "2010-01-27" doesn't overflow the maximum value "".11 PASS The value "2010-01-27" doesn't overflow the maximum value "".12 PASS The value "2010-01-27" doesn't overflow the maximum value "foo".13 PASS The value "2010-01-27" doesn't overflow the maximum value "2010-01-27".14 PASS The value "2010-01-27" doesn't overflow the maximum value "2010-01-28".15 PASS The value "2010-01-27" doesn't overflow the maximum value "2011-01-26".16 PASS The value "foo" doesn't overflow the maximum value "2011-01-26".17 PASS The value "2010-01-27" doesn't overflow the maximum value "0000-01-01".18 PASS The value "2010-01-27" overflows the maximum value "2010-01-26".19 PASS The value "9999-01-01" overflows the maximum value "2010-12-31".20 PASS The value "2010-01-27" overflows the maximum value "2010-01-26".21 PASS The value "9999-01-01" doesn't overflow the maximum value "2010-12-31" when disabled.22 23 Type=datetime24 PASS The value "2010-01-27T12:34Z" doesn't overflow the maximum value "".25 PASS The value "2010-01-27T12:34Z" doesn't overflow the maximum value "".26 PASS The value "2010-01-27T12:34Z" doesn't overflow the maximum value "foo".27 PASS The value "2010-01-27T12:34Z" doesn't overflow the maximum value "2010-01-27T12:34Z".28 PASS The value "2010-01-27T12:34Z" doesn't overflow the maximum value "2010-01-27T12:34:56Z".29 PASS The value "2010-01-27T12:34Z" doesn't overflow the maximum value "2011-01-26T12:34Z".30 PASS The value "foo" doesn't overflow the maximum value "2011-01-26T12:34Z".31 PASS The value "2010-01-27T12:34Z" doesn't overflow the maximum value "0000-01-01T00:00Z".32 PASS The value "2010-01-27T12:34Z" overflows the maximum value "2010-01-26T12:33:59.999Z".33 PASS The value "9999-01-01T23:59Z" overflows the maximum value "2010-12-31T00:00Z".34 PASS The value "2010-01-27T12:34Z" overflows the maximum value "2010-01-26T12:34Z".35 PASS The value "9999-01-01T23:59Z" doesn't overflow the maximum value "2010-12-31T00:00Z" when disabled.36 37 Type=datetime-local38 PASS The value "2010-01-27T12:34" doesn't overflow the maximum value "".39 PASS The value "2010-01-27T12:34" doesn't overflow the maximum value "".40 PASS The value "2010-01-27T12:34" doesn't overflow the maximum value "foo".41 PASS The value "2010-01-27T12:34" doesn't overflow the maximum value "2010-01-27T12:34".42 PASS The value "2010-01-27T12:34" doesn't overflow the maximum value "2010-01-27T12:34:56".43 PASS The value "2010-01-27T12:34" doesn't overflow the maximum value "2011-01-26T12:34".44 PASS The value "foo" doesn't overflow the maximum value "2011-01-26T12:34".45 PASS The value "2010-01-27T12:34" doesn't overflow the maximum value "0000-01-01T00:00".46 PASS The value "2010-01-27T12:34" overflows the maximum value "2010-01-26T12:33:59.999".47 PASS The value "9999-01-01T23:59" overflows the maximum value "2010-12-31T00:00".48 PASS The value "2010-01-27T12:34" overflows the maximum value "2010-01-26T12:34".49 PASS The value "9999-01-01T23:59" doesn't overflow the maximum value "2010-12-31T00:00" when disabled.50 51 Type=number52 PASS The value "99" doesn't overflow the maximum value "100".53 PASS The value "-101" doesn't overflow the maximum value "-100".54 PASS The value "99" doesn't overflow the maximum value "1E+2".55 PASS The value "0.99" doesn't overflow the maximum value "1.00".56 PASS The value "" doesn't overflow the maximum value "100".57 PASS The value "" doesn't overflow the maximum value "-1".58 PASS The value "101" doesn't overflow the maximum value "".59 PASS The value "101" doesn't overflow the maximum value "xxx".60 PASS The value "0.999999999999999999999999999999999999999999" doesn't overflow the maximum value "0.999999999999999999999999999999999999999998".61 PASS The value "101" overflows the maximum value "100".62 PASS The value "-99" overflows the maximum value "-100".63 PASS The value "101" overflows the maximum value "1E+2".64 PASS The value "101" overflows the maximum value "100".65 PASS The value "101" doesn't overflow the maximum value "1E+2" when disabled.66 67 Type=time68 6 PASS The value "13:16" doesn't overflow the maximum value "". 69 7 PASS The value "13:16" doesn't overflow the maximum value "". -
trunk/LayoutTests/fast/forms/time/ValidityState-rangeOverflow-time.html
r92745 r92746 1 description('This test aims to check for rangeOverflow flag with input fields'); 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <link rel="stylesheet" href="../../js/resources/js-test-style.css"> 5 <script src="../../js/resources/js-test-pre.js"></script> 6 </head> 7 <body> 8 <p id="description"></p> 9 <div id="console"></div> 10 <script> 11 description('This test aims to check for rangeOverflow flag with time input fields'); 2 12 3 13 var input = document.createElement('input'); … … 33 43 } 34 44 35 // ----------------------------------------------------------------36 debug('Type=text');37 input.type = 'text'; // No overflow for type=text.38 checkNotOverflow('101', '100');39 40 // ----------------------------------------------------------------41 debug('');42 debug('Type=date');43 input.type = 'date';44 input.min = '';45 // No overflow cases46 checkNotOverflow('2010-01-27', null);47 checkNotOverflow('2010-01-27', '');48 checkNotOverflow('2010-01-27', 'foo');49 checkNotOverflow('2010-01-27', '2010-01-27');50 checkNotOverflow('2010-01-27', '2010-01-28');51 checkNotOverflow('2010-01-27', '2011-01-26');52 checkNotOverflow('foo', '2011-01-26');53 checkNotOverflow('2010-01-27', '0000-01-01'); // Too small max value.54 55 // Overflow cases56 checkOverflow('2010-01-27', '2010-01-26');57 checkOverflow('9999-01-01', '2010-12-31');58 input.min = '2010-01-28'; // value < min && value > max59 checkOverflow('2010-01-27', '2010-01-26');60 61 // Disabled62 checkNotOverflow('9999-01-01', '2010-12-31', true);63 64 // ----------------------------------------------------------------65 debug('');66 debug('Type=datetime');67 input.type = 'datetime';68 input.min = '';69 // No overflow cases70 checkNotOverflow('2010-01-27T12:34Z', null);71 checkNotOverflow('2010-01-27T12:34Z', '');72 checkNotOverflow('2010-01-27T12:34Z', 'foo');73 checkNotOverflow('2010-01-27T12:34Z', '2010-01-27T12:34Z');74 checkNotOverflow('2010-01-27T12:34Z', '2010-01-27T12:34:56Z');75 checkNotOverflow('2010-01-27T12:34Z', '2011-01-26T12:34Z');76 checkNotOverflow('foo', '2011-01-26T12:34Z');77 checkNotOverflow('2010-01-27T12:34Z', '0000-01-01T00:00Z'); // Too small max value.78 79 // Overflow cases80 checkOverflow('2010-01-27T12:34Z', '2010-01-26T12:33:59.999Z');81 checkOverflow('9999-01-01T23:59Z', '2010-12-31T00:00Z');82 input.min = '2010-01-28T12:00Z'; // value < min && value > max83 checkOverflow('2010-01-27T12:34Z', '2010-01-26T12:34Z');84 85 // Disabled86 checkNotOverflow('9999-01-01T23:59Z', '2010-12-31T00:00Z', true);87 88 // ----------------------------------------------------------------89 debug('');90 debug('Type=datetime-local');91 input.type = 'datetime-local';92 input.min = '';93 // No overflow cases94 checkNotOverflow('2010-01-27T12:34', null);95 checkNotOverflow('2010-01-27T12:34', '');96 checkNotOverflow('2010-01-27T12:34', 'foo');97 checkNotOverflow('2010-01-27T12:34', '2010-01-27T12:34');98 checkNotOverflow('2010-01-27T12:34', '2010-01-27T12:34:56');99 checkNotOverflow('2010-01-27T12:34', '2011-01-26T12:34');100 checkNotOverflow('foo', '2011-01-26T12:34');101 checkNotOverflow('2010-01-27T12:34', '0000-01-01T00:00'); // Too small max value.102 103 // Overflow cases104 checkOverflow('2010-01-27T12:34', '2010-01-26T12:33:59.999');105 checkOverflow('9999-01-01T23:59', '2010-12-31T00:00');106 input.min = '2010-01-28T12:00'; // value < min && value > max107 checkOverflow('2010-01-27T12:34', '2010-01-26T12:34');108 109 // Disabled110 checkNotOverflow('9999-01-01T23:59', '2010-12-31T00:00', true);111 112 // ----------------------------------------------------------------113 debug('');114 debug('Type=number');115 input.type = 'number';116 input.min = '';117 checkNotOverflow('99', '100'); // Very normal case.118 checkNotOverflow('-101', '-100');119 checkNotOverflow('99', '1E+2');120 checkNotOverflow('0.99', '1.00');121 checkNotOverflow('abc', '100'); // Invalid value.122 checkNotOverflow('', '-1'); // No value.123 checkNotOverflow('101', ''); // No max.124 checkNotOverflow('101', 'xxx'); // Invalid max.125 // The following case should be rangeOverflow==true ideally. But the "double" type doesn't have enough precision.126 checkNotOverflow('0.999999999999999999999999999999999999999999', '0.999999999999999999999999999999999999999998');127 128 // Overflow cases129 checkOverflow('101', '100');130 checkOverflow('-99', '-100');131 checkOverflow('101', '1E+2');132 input.min = '200'; // value < min && value > max133 checkOverflow('101', '100');134 135 // Disabled136 checkNotOverflow('101', '1E+2', true);137 138 // ----------------------------------------------------------------139 debug('');140 debug('Type=time');141 45 input.type = 'time'; 142 46 input.min = ''; … … 160 64 161 65 var successfullyParsed = true; 66 </script> 67 <script src="../../js/resources/js-test-post.js"></script> 68 </body> 69 </html> -
trunk/LayoutTests/fast/forms/time/ValidityState-rangeUnderflow-time-expected.txt
r92745 r92746 1 This test aims to check for rangeUnderflow flag with input fields1 This test aims to check for rangeUnderflow flag with time input fields 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 Type=text7 PASS The value "99" doesn't underflow the minimum value "100".8 9 Type=date10 PASS The value "2010-01-27" doesn't underflow the minimum value "".11 PASS The value "2010-01-27" doesn't underflow the minimum value "".12 PASS The value "2010-01-27" doesn't underflow the minimum value "foo".13 PASS The value "1000-01-01" doesn't underflow the minimum value "".14 PASS The value "1582-10-15" doesn't underflow the minimum value "".15 PASS The value "2010-01-27" doesn't underflow the minimum value "2010-01-26".16 PASS The value "2010-01-27" doesn't underflow the minimum value "2009-01-28".17 PASS The value "foo" doesn't underflow the minimum value "2011-01-26".18 PASS The value "2010-01-27" undeflows the minimum value "2010-01-28".19 PASS The value "9999-01-01" undeflows the minimum value "10000-12-31".20 PASS The value "2010-01-27" undeflows the minimum value "2010-02-01".21 PASS The value "9999-01-01" doesn't underflow the minimum value "10000-12-31" when disabled.22 23 Type=datetime24 PASS The value "2010-01-27T12:34Z" doesn't underflow the minimum value "".25 PASS The value "2010-01-27T12:34Z" doesn't underflow the minimum value "".26 PASS The value "2010-01-27T12:34Z" doesn't underflow the minimum value "foo".27 PASS The value "1000-01-01T12:34Z" doesn't underflow the minimum value "".28 PASS The value "1582-10-15T00:00Z" doesn't underflow the minimum value "".29 PASS The value "2010-01-27T12:34Z" doesn't underflow the minimum value "2010-01-26T00:00Z".30 PASS The value "2010-01-27T12:34Z" doesn't underflow the minimum value "2009-01-28T00:00Z".31 PASS The value "foo" doesn't underflow the minimum value "2011-01-26T00:00Z".32 PASS The value "2010-01-27T12:34Z" undeflows the minimum value "2010-01-27T13:00Z".33 PASS The value "9999-01-01T12:00Z" undeflows the minimum value "10000-12-31T12:00Z".34 PASS The value "2010-01-27T12:00Z" undeflows the minimum value "2010-02-01T12:00Z".35 PASS The value "9999-01-01T12:00Z" doesn't underflow the minimum value "10000-12-31T12:00Z" when disabled.36 37 Type=datetime-local38 PASS The value "2010-01-27T12:34" doesn't underflow the minimum value "".39 PASS The value "2010-01-27T12:34" doesn't underflow the minimum value "".40 PASS The value "2010-01-27T12:34" doesn't underflow the minimum value "foo".41 PASS The value "1000-01-01T12:34" doesn't underflow the minimum value "".42 PASS The value "1582-10-15T00:00" doesn't underflow the minimum value "".43 PASS The value "2010-01-27T12:34" doesn't underflow the minimum value "2010-01-26T00:00".44 PASS The value "2010-01-27T12:34" doesn't underflow the minimum value "2009-01-28T00:00".45 PASS The value "foo" doesn't underflow the minimum value "2011-01-26T00:00".46 PASS The value "2010-01-27T12:34" undeflows the minimum value "2010-01-27T13:00".47 PASS The value "9999-01-01T12:00" undeflows the minimum value "10000-12-31T12:00".48 PASS The value "2010-01-27T12:00" undeflows the minimum value "2010-02-01T12:00".49 PASS The value "9999-01-01T12:00" doesn't underflow the minimum value "10000-12-31T12:00" when disabled.50 51 Type=number52 PASS The value "101" doesn't underflow the minimum value "100".53 PASS The value "-99" doesn't underflow the minimum value "-100".54 PASS The value "101" doesn't underflow the minimum value "1E+2".55 PASS The value "1.01" doesn't underflow the minimum value "1.00".56 PASS The value "" doesn't underflow the minimum value "100".57 PASS The value "" doesn't underflow the minimum value "1".58 PASS The value "-1" doesn't underflow the minimum value "".59 PASS The value "-1" doesn't underflow the minimum value "xxx".60 PASS The value "0.999999999999999999999999999999999999999998" doesn't underflow the minimum value "0.999999999999999999999999999999999999999999".61 PASS The value "99" undeflows the minimum value "100".62 PASS The value "-101" undeflows the minimum value "-100".63 PASS The value "99" undeflows the minimum value "1E+2".64 PASS The value "101" undeflows the minimum value "200".65 PASS The value "99" doesn't underflow the minimum value "1E+2" when disabled.66 67 Type=time68 6 PASS The value "13:16" doesn't underflow the minimum value "". 69 7 PASS The value "13:16" doesn't underflow the minimum value "". -
trunk/LayoutTests/fast/forms/time/ValidityState-rangeUnderflow-time.html
r92745 r92746 1 description('This test aims to check for rangeUnderflow flag with input fields'); 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <link rel="stylesheet" href="../../js/resources/js-test-style.css"> 5 <script src="../../js/resources/js-test-pre.js"></script> 6 </head> 7 <body> 8 <p id="description"></p> 9 <div id="console"></div> 10 <script> 11 description('This test aims to check for rangeUnderflow flag with time input fields'); 2 12 3 13 var input = document.createElement('input'); … … 33 43 } 34 44 35 // ----------------------------------------------------------------36 debug('Type=text');37 input.type = 'text'; // No underflow for type=text.38 checkNotUnderflow('99', '100');39 40 // ----------------------------------------------------------------41 debug('');42 debug('Type=date');43 input.type = 'date';44 input.max = '';45 // No underflow cases46 checkNotUnderflow('2010-01-27', null);47 checkNotUnderflow('2010-01-27', '');48 checkNotUnderflow('2010-01-27', 'foo');49 // 1000-01-01 is smaller than the implicit minimum value.50 // But the date parser rejects it before comparing the minimum value.51 checkNotUnderflow('1000-01-01', '');52 checkNotUnderflow('1582-10-15', '');53 checkNotUnderflow('2010-01-27', '2010-01-26');54 checkNotUnderflow('2010-01-27', '2009-01-28');55 checkNotUnderflow('foo', '2011-01-26');56 57 // Underflow cases58 checkUnderflow('2010-01-27', '2010-01-28');59 checkUnderflow('9999-01-01', '10000-12-31');60 input.max = '2010-01-01'; // value < min && value > max61 checkUnderflow('2010-01-27', '2010-02-01');62 63 // Disabled64 checkNotUnderflow('9999-01-01', '10000-12-31', true);65 66 // ----------------------------------------------------------------67 debug('');68 debug('Type=datetime');69 input.type = 'datetime';70 input.max = '';71 // No underflow cases72 checkNotUnderflow('2010-01-27T12:34Z', null);73 checkNotUnderflow('2010-01-27T12:34Z', '');74 checkNotUnderflow('2010-01-27T12:34Z', 'foo');75 // 1000-01-01 is smaller than the implicit minimum value.76 // But the date parser rejects it before comparing the minimum value.77 checkNotUnderflow('1000-01-01T12:34Z', '');78 checkNotUnderflow('1582-10-15T00:00Z', '');79 checkNotUnderflow('2010-01-27T12:34Z', '2010-01-26T00:00Z');80 checkNotUnderflow('2010-01-27T12:34Z', '2009-01-28T00:00Z');81 checkNotUnderflow('foo', '2011-01-26T00:00Z');82 83 // Underflow cases84 checkUnderflow('2010-01-27T12:34Z', '2010-01-27T13:00Z');85 checkUnderflow('9999-01-01T12:00Z', '10000-12-31T12:00Z');86 input.max = '2010-01-01T12:00Z'; // value < min && value > max87 checkUnderflow('2010-01-27T12:00Z', '2010-02-01T12:00Z');88 89 // Disabled90 checkNotUnderflow('9999-01-01T12:00Z', '10000-12-31T12:00Z', true);91 92 // ----------------------------------------------------------------93 debug('');94 debug('Type=datetime-local');95 input.type = 'datetime-local';96 input.max = '';97 // No underflow cases98 checkNotUnderflow('2010-01-27T12:34', null);99 checkNotUnderflow('2010-01-27T12:34', '');100 checkNotUnderflow('2010-01-27T12:34', 'foo');101 // 1000-01-01 is smaller than the implicit minimum value.102 // But the date parser rejects it before comparing the minimum value.103 checkNotUnderflow('1000-01-01T12:34', '');104 checkNotUnderflow('1582-10-15T00:00', '');105 checkNotUnderflow('2010-01-27T12:34', '2010-01-26T00:00');106 checkNotUnderflow('2010-01-27T12:34', '2009-01-28T00:00');107 checkNotUnderflow('foo', '2011-01-26T00:00');108 109 // Underflow cases110 checkUnderflow('2010-01-27T12:34', '2010-01-27T13:00');111 checkUnderflow('9999-01-01T12:00', '10000-12-31T12:00');112 input.max = '2010-01-01T12:00'; // value < min && value > max113 checkUnderflow('2010-01-27T12:00', '2010-02-01T12:00');114 115 // Disabled116 checkNotUnderflow('9999-01-01T12:00', '10000-12-31T12:00', true);117 118 // ----------------------------------------------------------------119 debug('');120 debug('Type=number');121 input.type = 'number';122 input.max = '';123 // No underflow cases124 input.type = 'number';125 checkNotUnderflow('101', '100'); // Very normal case.126 checkNotUnderflow('-99', '-100');127 checkNotUnderflow('101', '1E+2');128 checkNotUnderflow('1.01', '1.00');129 checkNotUnderflow('abc', '100'); // Invalid value.130 checkNotUnderflow('', '1'); // No value.131 checkNotUnderflow('-1', ''); // No min.132 checkNotUnderflow('-1', 'xxx'); // Invalid min.133 // The following case should be rangeUnderflow==true ideally. But the "double" type doesn't have enough precision.134 checkNotUnderflow('0.999999999999999999999999999999999999999998', '0.999999999999999999999999999999999999999999');135 136 // Underflow cases137 checkUnderflow('99', '100');138 checkUnderflow('-101', '-100');139 checkUnderflow('99', '1E+2');140 input.max = '100'; // value < min && value > max141 checkUnderflow('101', '200');142 143 // Disabled144 checkNotUnderflow('99', '1E+2', true);145 146 // ----------------------------------------------------------------147 debug('');148 debug('Type=time');149 45 input.type = 'time'; 150 46 input.max = ''; … … 169 65 170 66 var successfullyParsed = true; 67 </script> 68 <script src="../../js/resources/js-test-post.js"></script> 69 </body> 70 </html> -
trunk/LayoutTests/fast/forms/time/ValidityState-stepMismatch-time-expected.txt
r92745 r92746 1 Check stepMismatch results for type= date, datetime, datetime-local,time.1 Check stepMismatch results for type=time. 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 Date type7 Empty values8 PASS stepMismatchFor("", null, null) is false9 PASS stepMismatchFor("", "2", "1969-12-31") is false10 Normal step values11 PASS stepMismatchFor("2010-02-10", "2", "2010-02-09") is true12 PASS stepMismatchFor("2010-02-09", "2", "2010-02-09") is false13 PASS stepMismatchFor("2010-02-11", "2", "2010-02-09") is false14 PASS stepMismatchFor("1800-11-11", "3", "1800-11-09") is true15 PASS stepMismatchFor("1800-11-09", "3", "1800-11-09") is false16 PASS stepMismatchFor("1800-11-12", "3", "1800-11-09") is false17 PASS stepMismatchFor("275760-09-13", "3", "275760-09-11") is true18 PASS stepMismatchFor("275760-09-13", "2", "275760-09-11") is false19 Implicit step base20 PASS stepMismatchFor("1970-01-02", "2", null) is true21 PASS stepMismatchFor("1970-01-03", "2", null) is false22 Fractional step values23 PASS stepMismatchFor("2010-02-10", "0.1", "2010-02-09") is false24 PASS stepMismatchFor("2010-02-10", "1.1", "2010-02-09") is false25 PASS stepMismatchFor("2010-02-10", "1.9", "2010-02-09") is true26 Invalid or no step values27 PASS stepMismatchFor("2010-02-10", null, "2010-02-09") is false28 PASS stepMismatchFor("2010-02-10", "-1", "2010-02-09") is false29 PASS stepMismatchFor("2010-02-10", "foo", "2010-02-09") is false30 Special step value31 PASS stepMismatchFor("2010-02-10", "any", "2010-02-09") is false32 Disabled33 PASS stepMismatchFor("2010-02-10", "2", "2010-02-09", true) is false34 35 Datetime type36 Empty values37 PASS stepMismatchFor("", null, null) is false38 PASS stepMismatchFor("", "2", "1969-12-31T12:34:56Z") is false39 Normal step values40 PASS stepMismatchFor("2010-02-09T12:34:55Z", "1", "2010-02-09T12:34:56Z") is false41 PASS stepMismatchFor("2010-02-09T12:34:55.001Z", "1", "2010-02-09T12:34:56Z") is true42 PASS stepMismatchFor("2010-02-09T12:34:56.001Z", "0.001", "2010-02-09T12:34:56Z") is false43 PASS stepMismatchFor("2010-02-09T12:34:55Z", "0.333", "2010-02-09T12:34:56Z") is true44 PASS stepMismatchFor("2010-02-09T12:34:55.001Z", "0.333", "2010-02-09T12:34:56Z") is false45 PASS stepMismatchFor("2010-02-09T12:34Z", "86400", "2010-02-08T12:34Z") is false46 PASS stepMismatchFor("2010-02-09T12:34:56Z", "86400", "2010-02-08T12:34Z") is true47 PASS stepMismatchFor("275760-09-13T00:00Z", "3", "275760-09-12T23:59:50Z") is true48 PASS stepMismatchFor("275760-09-13T00:00Z", "2", "275760-09-12T23:59:50Z") is false49 PASS stepMismatchFor("0001-01-01T00:00Z", "3", "0001-01-11T00:00:02Z") is true50 PASS stepMismatchFor("0001-01-01T00:00Z", "2", "0001-01-11T00:00:02Z") is false51 Implicit step base52 PASS stepMismatchFor("1970-01-01T12:34Z", "120", null) is false53 PASS stepMismatchFor("1970-01-01T12:35Z", "120", null) is true54 Small step values55 PASS stepMismatchFor("2010-02-10T12:34:56.000Z", "0.0003", "2010-02-10T12:34.55.000Z") is false56 PASS stepMismatchFor("2010-02-10T12:34:55.001Z", "0.0019", "2010-02-10T12:34.55.000Z") is true57 Invalid or no step values58 PASS stepMismatchFor("2010-02-10T12:34Z", null, "2010-02-09T12:34Z") is false59 PASS stepMismatchFor("2010-02-10T12:34:56Z", null, "2010-02-09T12:34Z") is true60 PASS stepMismatchFor("2010-02-10T12:34Z", "-1", "2010-02-09T12:34Z") is false61 PASS stepMismatchFor("2010-02-10T12:34Z", "foo", "2010-02-09T12:34Z") is false62 Special step value63 PASS stepMismatchFor("2010-02-09T12:34Z", "any", "2010-02-09T12:34Z") is false64 Disabled65 PASS stepMismatchFor("2010-02-09T12:34:55.001Z", "1", "2010-02-09T12:34:56Z", true) is false66 67 Datetime-local type68 Empty values69 PASS stepMismatchFor("", null, null) is false70 PASS stepMismatchFor("", "2", "1969-12-31T12:34:56") is false71 Normal step values72 PASS stepMismatchFor("2010-02-09T12:34:55", "1", "2010-02-09T12:34:56") is false73 PASS stepMismatchFor("2010-02-09T12:34:55.001", "1", "2010-02-09T12:34:56") is true74 PASS stepMismatchFor("2010-02-09T12:34:56.001", "0.001", "2010-02-09T12:34:56") is false75 PASS stepMismatchFor("2010-02-09T12:34:55", "0.333", "2010-02-09T12:34:56") is true76 PASS stepMismatchFor("2010-02-09T12:34:55.001", "0.333", "2010-02-09T12:34:56") is false77 PASS stepMismatchFor("2010-02-09T12:34", "86400", "2010-02-08T12:34") is false78 PASS stepMismatchFor("2010-02-09T12:34:56", "86400", "2010-02-08T12:34") is true79 PASS stepMismatchFor("275760-09-13T00:00", "3", "275760-09-12T23:59:50") is true80 PASS stepMismatchFor("275760-09-13T00:00", "2", "275760-09-12T23:59:50") is false81 PASS stepMismatchFor("0001-01-01T00:00", "3", "0001-01-11T00:00:02") is true82 PASS stepMismatchFor("0001-01-01T00:00", "2", "0001-01-11T00:00:02") is false83 Implicit step base84 PASS stepMismatchFor("1970-01-01T12:34", "120", null) is false85 PASS stepMismatchFor("1970-01-01T12:35", "120", null) is true86 Small step values87 PASS stepMismatchFor("2010-02-10T12:34:56.000", "0.0003", "2010-02-10T12:34.55.000") is false88 PASS stepMismatchFor("2010-02-10T12:34:55.001", "0.0019", "2010-02-10T12:34.55.000") is true89 Invalid or no step values90 PASS stepMismatchFor("2010-02-10T12:34", null, "2010-02-09T12:34") is false91 PASS stepMismatchFor("2010-02-10T12:34:56", null, "2010-02-09T12:34") is true92 PASS stepMismatchFor("2010-02-10T12:34", "-1", "2010-02-09T12:34") is false93 PASS stepMismatchFor("2010-02-10T12:34", "foo", "2010-02-09T12:34") is false94 Special step value95 PASS stepMismatchFor("2010-02-09T12:34", "any", "2010-02-09T12:34") is false96 Disabled97 PASS stepMismatchFor("2010-02-09T12:34:55.001", "1", "2010-02-09T12:34:56", true) is false98 99 Number type100 Empty values101 PASS stepMismatchFor("", null, null) is false102 PASS stepMismatchFor("", "1.0", "0.1") is false103 Integers104 PASS stepMismatchFor("1", "2", "0") is true105 PASS stepMismatchFor("-3", "2", "-4") is true106 PASS input.max = "5"; stepMismatchFor("5", "3", "0") is true107 PASS input.value is "5"108 Invalid step values109 PASS stepMismatchFor("-3", "-2", "-4") is false110 PASS stepMismatchFor("-3", null, "-4") is false111 PASS stepMismatchFor("-3", undefined, "-4") is false112 Huge numbers and small step; uncomparable113 PASS stepMismatchFor("3.40282347e+38", "3", "") is false114 PASS stepMismatchFor("3.40282346e+38", "3", "") is false115 PASS stepMismatchFor("3.40282345e+38", "3", "") is false116 Huge numbers and huge step117 PASS stepMismatchFor("3.20e+38", "0.20e+38", "") is false118 PASS stepMismatchFor("3.20e+38", "0.22e+38", "") is true119 Fractional numbers120 PASS stepMismatchFor("0.9", "0.1", "") is false121 PASS stepMismatchFor("0.9", "0.1000001", "") is true122 PASS stepMismatchFor("0.9", "0.1000000000000001", "") is false123 PASS stepMismatchFor("1.0", "0.3333333333333333", "") is false124 Rounding125 PASS stepMismatchFor("5.005", "0.005", "4") is false126 Disabled127 PASS stepMismatchFor("1", "2", "0", true) is false128 129 Range type130 Empty values131 PASS stepMismatchFor("", null, null) is false132 PASS stepMismatchFor("", "1.0", "0.1") is false133 Integers134 PASS stepMismatchFor("1", "2", "0") is false135 PASS stepMismatchFor("-3", "2", "-4") is false136 PASS input.max = "5"; stepMismatchFor("5", "3", "0") is false137 PASS input.value is "3"138 Invalid step values139 PASS stepMismatchFor("-3", "-2", "-4") is false140 PASS stepMismatchFor("-3", null, "-4") is false141 PASS stepMismatchFor("-3", undefined, "-4") is false142 Huge numbers and small step; uncomparable143 PASS stepMismatchFor("3.40282347e+38", "3", "") is false144 PASS stepMismatchFor("3.40282346e+38", "3", "") is false145 PASS stepMismatchFor("3.40282345e+38", "3", "") is false146 Huge numbers and huge step147 PASS stepMismatchFor("3.20e+38", "0.20e+38", "") is false148 PASS stepMismatchFor("3.20e+38", "0.22e+38", "") is false149 Fractional numbers150 PASS stepMismatchFor("0.9", "0.1", "") is false151 PASS stepMismatchFor("0.9", "0.1000001", "") is false152 PASS stepMismatchFor("0.9", "0.1000000000000001", "") is false153 PASS stepMismatchFor("1.0", "0.3333333333333333", "") is false154 Disabled155 PASS stepMismatchFor("1", "2", "0", true) is false156 157 Time type158 6 Empty values 159 7 PASS stepMismatchFor("", null, null) is false … … 185 33 PASS stepMismatchFor("12:34:55.001", "1", "12:34:56", true) is false 186 34 187 Unsupported types188 PASS input.type = "text"; input.step = "3"; input.min = ""; input.value = "2"; input.validity.stepMismatch is false189 PASS input.type = "button"; input.validity.stepMismatch is false190 PASS input.type = "checkbox"; input.validity.stepMismatch is false191 PASS input.type = "color"; input.validity.stepMismatch is false192 PASS input.type = "email"; input.validity.stepMismatch is false193 PASS input.type = "hidden"; input.validity.stepMismatch is false194 PASS input.type = "image"; input.validity.stepMismatch is false195 PASS input.type = "khtml_isindex"; input.validity.stepMismatch is false196 PASS input.type = "passwd"; input.validity.stepMismatch is false197 PASS input.type = "radio"; input.validity.stepMismatch is false198 PASS input.type = "reset"; input.validity.stepMismatch is false199 PASS input.type = "search"; input.validity.stepMismatch is false200 PASS input.type = "submit"; input.validity.stepMismatch is false201 PASS input.type = "tel"; input.validity.stepMismatch is false202 PASS input.type = "url"; input.validity.stepMismatch is false203 PASS input.type = "file"; input.validity.stepMismatch is false204 35 PASS successfullyParsed is true 205 36 -
trunk/LayoutTests/fast/forms/time/ValidityState-stepMismatch-time.html
r92745 r92746 1 description('Check stepMismatch results for type=date, datetime, datetime-local, time.'); 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <link rel="stylesheet" href="../../js/resources/js-test-style.css"> 5 <script src="../../js/resources/js-test-pre.js"></script> 6 </head> 7 <body> 8 <p id="description"></p> 9 <div id="console"></div> 10 <script> 11 description('Check stepMismatch results for type=time.'); 2 12 3 13 var input = document.createElement('input'); … … 12 22 } 13 23 14 debug('Date type');15 input.type = 'date';16 debug('Empty values');17 shouldBeFalse('stepMismatchFor("", null, null)');18 shouldBeFalse('stepMismatchFor("", "2", "1969-12-31")');19 debug('Normal step values');20 shouldBeTrue('stepMismatchFor("2010-02-10", "2", "2010-02-09")');21 shouldBeFalse('stepMismatchFor("2010-02-09", "2", "2010-02-09")');22 shouldBeFalse('stepMismatchFor("2010-02-11", "2", "2010-02-09")');23 shouldBeTrue('stepMismatchFor("1800-11-11", "3", "1800-11-09")');24 shouldBeFalse('stepMismatchFor("1800-11-09", "3", "1800-11-09")');25 shouldBeFalse('stepMismatchFor("1800-11-12", "3", "1800-11-09")');26 shouldBeTrue('stepMismatchFor("275760-09-13", "3", "275760-09-11")');27 shouldBeFalse('stepMismatchFor("275760-09-13", "2", "275760-09-11")');28 debug('Implicit step base');29 shouldBeTrue('stepMismatchFor("1970-01-02", "2", null)');30 shouldBeFalse('stepMismatchFor("1970-01-03", "2", null)');31 debug('Fractional step values');32 shouldBeFalse('stepMismatchFor("2010-02-10", "0.1", "2010-02-09")');33 shouldBeFalse('stepMismatchFor("2010-02-10", "1.1", "2010-02-09")');34 shouldBeTrue('stepMismatchFor("2010-02-10", "1.9", "2010-02-09")');35 debug('Invalid or no step values');36 shouldBeFalse('stepMismatchFor("2010-02-10", null, "2010-02-09")');37 shouldBeFalse('stepMismatchFor("2010-02-10", "-1", "2010-02-09")');38 shouldBeFalse('stepMismatchFor("2010-02-10", "foo", "2010-02-09")');39 debug('Special step value');40 shouldBeFalse('stepMismatchFor("2010-02-10", "any", "2010-02-09")');41 debug('Disabled');42 shouldBeFalse('stepMismatchFor("2010-02-10", "2", "2010-02-09", true)');43 44 debug('');45 debug('Datetime type');46 input.type = 'datetime';47 debug('Empty values');48 shouldBeFalse('stepMismatchFor("", null, null)');49 shouldBeFalse('stepMismatchFor("", "2", "1969-12-31T12:34:56Z")');50 debug('Normal step values');51 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:55Z", "1", "2010-02-09T12:34:56Z")');52 shouldBeTrue('stepMismatchFor("2010-02-09T12:34:55.001Z", "1", "2010-02-09T12:34:56Z")');53 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:56.001Z", "0.001", "2010-02-09T12:34:56Z")');54 shouldBeTrue('stepMismatchFor("2010-02-09T12:34:55Z", "0.333", "2010-02-09T12:34:56Z")');55 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:55.001Z", "0.333", "2010-02-09T12:34:56Z")');56 shouldBeFalse('stepMismatchFor("2010-02-09T12:34Z", "86400", "2010-02-08T12:34Z")');57 shouldBeTrue('stepMismatchFor("2010-02-09T12:34:56Z", "86400", "2010-02-08T12:34Z")');58 shouldBeTrue('stepMismatchFor("275760-09-13T00:00Z", "3", "275760-09-12T23:59:50Z")');59 shouldBeFalse('stepMismatchFor("275760-09-13T00:00Z", "2", "275760-09-12T23:59:50Z")');60 shouldBeTrue('stepMismatchFor("0001-01-01T00:00Z", "3", "0001-01-11T00:00:02Z")');61 shouldBeFalse('stepMismatchFor("0001-01-01T00:00Z", "2", "0001-01-11T00:00:02Z")');62 debug('Implicit step base');63 shouldBeFalse('stepMismatchFor("1970-01-01T12:34Z", "120", null)');64 shouldBeTrue('stepMismatchFor("1970-01-01T12:35Z", "120", null)');65 debug('Small step values');66 shouldBeFalse('stepMismatchFor("2010-02-10T12:34:56.000Z", "0.0003", "2010-02-10T12:34.55.000Z")');67 shouldBeTrue('stepMismatchFor("2010-02-10T12:34:55.001Z", "0.0019", "2010-02-10T12:34.55.000Z")');68 debug('Invalid or no step values');69 shouldBeFalse('stepMismatchFor("2010-02-10T12:34Z", null, "2010-02-09T12:34Z")');70 shouldBeTrue('stepMismatchFor("2010-02-10T12:34:56Z", null, "2010-02-09T12:34Z")');71 shouldBeFalse('stepMismatchFor("2010-02-10T12:34Z", "-1", "2010-02-09T12:34Z")');72 shouldBeFalse('stepMismatchFor("2010-02-10T12:34Z", "foo", "2010-02-09T12:34Z")');73 debug('Special step value');74 shouldBeFalse('stepMismatchFor("2010-02-09T12:34Z", "any", "2010-02-09T12:34Z")');75 debug('Disabled');76 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:55.001Z", "1", "2010-02-09T12:34:56Z", true)');77 78 debug('');79 debug('Datetime-local type');80 input.type = 'datetime-local';81 debug('Empty values');82 shouldBeFalse('stepMismatchFor("", null, null)');83 shouldBeFalse('stepMismatchFor("", "2", "1969-12-31T12:34:56")');84 debug('Normal step values');85 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:55", "1", "2010-02-09T12:34:56")');86 shouldBeTrue('stepMismatchFor("2010-02-09T12:34:55.001", "1", "2010-02-09T12:34:56")');87 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:56.001", "0.001", "2010-02-09T12:34:56")');88 shouldBeTrue('stepMismatchFor("2010-02-09T12:34:55", "0.333", "2010-02-09T12:34:56")');89 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:55.001", "0.333", "2010-02-09T12:34:56")');90 shouldBeFalse('stepMismatchFor("2010-02-09T12:34", "86400", "2010-02-08T12:34")');91 shouldBeTrue('stepMismatchFor("2010-02-09T12:34:56", "86400", "2010-02-08T12:34")');92 shouldBeTrue('stepMismatchFor("275760-09-13T00:00", "3", "275760-09-12T23:59:50")');93 shouldBeFalse('stepMismatchFor("275760-09-13T00:00", "2", "275760-09-12T23:59:50")');94 shouldBeTrue('stepMismatchFor("0001-01-01T00:00", "3", "0001-01-11T00:00:02")');95 shouldBeFalse('stepMismatchFor("0001-01-01T00:00", "2", "0001-01-11T00:00:02")');96 debug('Implicit step base');97 shouldBeFalse('stepMismatchFor("1970-01-01T12:34", "120", null)');98 shouldBeTrue('stepMismatchFor("1970-01-01T12:35", "120", null)');99 debug('Small step values');100 shouldBeFalse('stepMismatchFor("2010-02-10T12:34:56.000", "0.0003", "2010-02-10T12:34.55.000")');101 shouldBeTrue('stepMismatchFor("2010-02-10T12:34:55.001", "0.0019", "2010-02-10T12:34.55.000")');102 debug('Invalid or no step values');103 shouldBeFalse('stepMismatchFor("2010-02-10T12:34", null, "2010-02-09T12:34")');104 shouldBeTrue('stepMismatchFor("2010-02-10T12:34:56", null, "2010-02-09T12:34")');105 shouldBeFalse('stepMismatchFor("2010-02-10T12:34", "-1", "2010-02-09T12:34")');106 shouldBeFalse('stepMismatchFor("2010-02-10T12:34", "foo", "2010-02-09T12:34")');107 debug('Special step value');108 shouldBeFalse('stepMismatchFor("2010-02-09T12:34", "any", "2010-02-09T12:34")');109 debug('Disabled');110 shouldBeFalse('stepMismatchFor("2010-02-09T12:34:55.001", "1", "2010-02-09T12:34:56", true)');111 112 debug('');113 debug('Number type');114 input.type = 'number';115 debug('Empty values');116 shouldBe('stepMismatchFor("", null, null)', 'false');117 shouldBe('stepMismatchFor("", "1.0", "0.1")', 'false');118 debug('Integers');119 shouldBe('stepMismatchFor("1", "2", "0")', 'true');120 shouldBe('stepMismatchFor("-3", "2", "-4")', 'true');121 shouldBe('input.max = "5"; stepMismatchFor("5", "3", "0")', 'true');122 shouldBe('input.value', '"5"');123 debug('Invalid step values');124 input.max = '';125 shouldBe('stepMismatchFor("-3", "-2", "-4")', 'false');126 shouldBe('stepMismatchFor("-3", null, "-4")', 'false');127 shouldBe('stepMismatchFor("-3", undefined, "-4")', 'false');128 debug('Huge numbers and small step; uncomparable');129 shouldBe('stepMismatchFor("3.40282347e+38", "3", "")', 'false');130 shouldBe('stepMismatchFor("3.40282346e+38", "3", "")', 'false');131 shouldBe('stepMismatchFor("3.40282345e+38", "3", "")', 'false');132 debug('Huge numbers and huge step');133 shouldBe('stepMismatchFor("3.20e+38", "0.20e+38", "")', 'false');134 shouldBe('stepMismatchFor("3.20e+38", "0.22e+38", "")', 'true');135 debug('Fractional numbers');136 shouldBe('stepMismatchFor("0.9", "0.1", "")', 'false');137 shouldBe('stepMismatchFor("0.9", "0.1000001", "")', 'true');138 shouldBe('stepMismatchFor("0.9", "0.1000000000000001", "")', 'false');139 shouldBe('stepMismatchFor("1.0", "0.3333333333333333", "")', 'false');140 debug('Rounding');141 shouldBe('stepMismatchFor("5.005", "0.005", "4")', 'false');142 debug('Disabled');143 shouldBe('stepMismatchFor("1", "2", "0", true)', 'false');144 145 debug('');146 debug('Range type');147 input.type = 'range';148 // The following test inputs are the same as inputs for type=numbe,149 // but all expected results should be 'false'.150 debug('Empty values');151 shouldBe('stepMismatchFor("", null, null)', 'false');152 shouldBe('stepMismatchFor("", "1.0", "0.1")', 'false');153 debug('Integers');154 shouldBe('stepMismatchFor("1", "2", "0")', 'false');155 shouldBe('stepMismatchFor("-3", "2", "-4")', 'false');156 shouldBe('input.max = "5"; stepMismatchFor("5", "3", "0")', 'false');157 shouldBe('input.value', '"3"'); // Different from type=number.158 debug('Invalid step values');159 input.max = '';160 shouldBe('stepMismatchFor("-3", "-2", "-4")', 'false');161 shouldBe('stepMismatchFor("-3", null, "-4")', 'false');162 shouldBe('stepMismatchFor("-3", undefined, "-4")', 'false');163 debug('Huge numbers and small step; uncomparable');164 shouldBe('stepMismatchFor("3.40282347e+38", "3", "")', 'false');165 shouldBe('stepMismatchFor("3.40282346e+38", "3", "")', 'false');166 shouldBe('stepMismatchFor("3.40282345e+38", "3", "")', 'false');167 debug('Huge numbers and huge step');168 shouldBe('stepMismatchFor("3.20e+38", "0.20e+38", "")', 'false');169 shouldBe('stepMismatchFor("3.20e+38", "0.22e+38", "")', 'false');170 debug('Fractional numbers');171 shouldBe('stepMismatchFor("0.9", "0.1", "")', 'false');172 shouldBe('stepMismatchFor("0.9", "0.1000001", "")', 'false');173 shouldBe('stepMismatchFor("0.9", "0.1000000000000001", "")', 'false');174 shouldBe('stepMismatchFor("1.0", "0.3333333333333333", "")', 'false');175 debug('Disabled');176 shouldBe('stepMismatchFor("1", "2", "0", true)', 'false');177 178 debug('');179 debug('Time type');180 24 input.type = 'time'; 181 25 debug('Empty values'); … … 209 53 210 54 debug(''); 211 debug('Unsupported types');212 shouldBe('input.type = "text"; input.step = "3"; input.min = ""; input.value = "2"; input.validity.stepMismatch', 'false');213 shouldBe('input.type = "button"; input.validity.stepMismatch', 'false');214 shouldBe('input.type = "checkbox"; input.validity.stepMismatch', 'false');215 shouldBe('input.type = "color"; input.validity.stepMismatch', 'false');216 shouldBe('input.type = "email"; input.validity.stepMismatch', 'false');217 shouldBe('input.type = "hidden"; input.validity.stepMismatch', 'false');218 shouldBe('input.type = "image"; input.validity.stepMismatch', 'false');219 shouldBe('input.type = "khtml_isindex"; input.validity.stepMismatch', 'false');220 shouldBe('input.type = "passwd"; input.validity.stepMismatch', 'false');221 shouldBe('input.type = "radio"; input.validity.stepMismatch', 'false');222 shouldBe('input.type = "reset"; input.validity.stepMismatch', 'false');223 shouldBe('input.type = "search"; input.validity.stepMismatch', 'false');224 shouldBe('input.type = "submit"; input.validity.stepMismatch', 'false');225 shouldBe('input.type = "tel"; input.validity.stepMismatch', 'false');226 shouldBe('input.type = "url"; input.validity.stepMismatch', 'false');227 shouldBe('input.type = "file"; input.validity.stepMismatch', 'false');228 229 55 var successfullyParsed = true; 56 </script> 57 <script src="../../js/resources/js-test-post.js"></script> 58 </body> 59 </html> -
trunk/LayoutTests/fast/forms/time/ValidityState-typeMismatch-time.html
r92745 r92746 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <link rel="stylesheet" href="../../js/resources/js-test-style.css"> 5 <script src="../../js/resources/js-test-pre.js"></script> 6 </head> 7 <body> 8 <p id="description"></p> 9 <div id="console"></div> 10 <script> 1 11 description('This test aims to check for typeMismatch flag with type=time input fields'); 2 12 var i = document.createElement('input'); … … 64 74 65 75 var successfullyParsed = true; 76 </script> 77 <script src="../../js/resources/js-test-post.js"></script> 78 </body> 79 </html> -
trunk/LayoutTests/fast/forms/time/input-valueasdate-time.html
r92745 r92746 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <link rel="stylesheet" href="../../js/resources/js-test-style.css"> 5 <script src="../../js/resources/js-test-pre.js"></script> 6 </head> 7 <body> 8 <p id="description"></p> 9 <div id="console"></div> 10 <script> 1 11 description('Tests for .valueAsDate with <input type=time>.'); 2 12 … … 45 55 46 56 var successfullyParsed = true; 57 </script> 58 <script src="../../js/resources/js-test-post.js"></script> 59 </body> 60 </html> -
trunk/LayoutTests/fast/forms/time/input-valueasnumber-time.html
r92745 r92746 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <link rel="stylesheet" href="../../js/resources/js-test-style.css"> 5 <script src="../../js/resources/js-test-pre.js"></script> 6 </head> 7 <body> 8 <p id="description"></p> 9 <div id="console"></div> 10 <script> 1 11 description('Tests for .valueAsNumber with <input type=time>.'); 2 12 … … 45 55 46 56 var successfullyParsed = true; 57 </script> 58 <script src="../../js/resources/js-test-post.js"></script> 59 </body> 60 </html> -
trunk/LayoutTests/fast/forms/time/time-input-type-expected.txt
r92745 r92746 4 4 5 5 6 PASS input.type for " week" is correctly "week".7 PASS input.type for " WEEK" is correctly "week".8 PASS input.type for " week" is correctly "text".6 PASS input.type for "time" is correctly "time". 7 PASS input.type for "TIME" is correctly "time". 8 PASS input.type for " time " is correctly "text". 9 9 PASS successfullyParsed is true 10 10 -
trunk/LayoutTests/fast/forms/time/time-input-type.html
r92745 r92746 23 23 } 24 24 25 check(" week", "week");26 check(" WEEK", "week");27 check(" week", "text");25 check("time", "time"); 26 check("TIME", "time"); 27 check(" time ", "text"); 28 28 29 29 var successfullyParsed = true; … … 32 32 </body> 33 33 </html> 34 -
trunk/LayoutTests/fast/forms/time/time-input-visible-string-expected.txt
r92745 r92746 1 1 The user-visible values of week input fields should be localized if the platform has a LocalizedDate implementation. Otherwise, they should be in the HTML5 formats. 2 2 3 week: value='2011-W17' visible='2011-W17'3 time: value='01:56:20.391' visible='01:56:20.391' 4 4 PASS successfullyParsed is true 5 5 -
trunk/LayoutTests/fast/forms/time/time-input-visible-string.html
r92745 r92746 2 2 <html> 3 3 <head> 4 <title> WeekInput Test</title>4 <title>Time Input Test</title> 5 5 <script src="../../js/resources/js-test-pre.js"></script> 6 6 </head> … … 10 10 11 11 <form method="get" action="#"> 12 <input type=" week"><br>12 <input type="time"><br> 13 13 </form> 14 14 -
trunk/LayoutTests/fast/forms/time/time-stepup-stepdown-expected.txt
r92745 r92746 1 Check stepUp() and stepDown() bahevior for type= date, datetime, datetime-local,time.1 Check stepUp() and stepDown() bahevior for type=time. 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 Date type7 Invalid value8 PASS stepUp("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.9 PASS stepDown("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.10 Non-number arguments11 PASS stepUp("2010-02-10", null, null, "0") is "2010-02-10"12 PASS stepDown("2010-02-10", null, null, "0") is "2010-02-10"13 PASS stepUp("2010-02-10", null, null, "foo") is "2010-02-10"14 PASS stepDown("2010-02-10", null, null, "foo") is "2010-02-10"15 PASS stepUp("2010-02-10", null, null, null) is "2010-02-10"16 PASS stepDown("2010-02-10", null, null, null) is "2010-02-10"17 Normal cases18 PASS stepUp("2010-02-10", null, null) is "2010-02-11"19 PASS stepDown("2010-02-10", null, null) is "2010-02-09"20 PASS stepUp("2010-02-10", null, null, 10) is "2010-02-20"21 PASS stepDown("2010-02-10", null, null, 11) is "2010-01-30"22 PASS stepUp("1970-01-01", "4", null, 2) is "1970-01-09"23 PASS stepDown("1970-01-01", "4", null, 3) is "1969-12-20"24 Step=any25 PASS stepUp("2010-02-10", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.26 PASS stepDown("2010-02-10", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.27 Overflow/underflow28 PASS stepUp("2010-02-10", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.29 PASS stepDown("2010-02-10", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.30 PASS stepUp("2010-02-10", "1", "2010-02-10") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.31 PASS stepDown("2010-02-10", "1", "2010-02-10") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.32 33 Datetime type34 Invalid value35 PASS stepUp("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.36 PASS stepDown("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.37 Non-number arguments38 PASS stepUp("2010-02-10T20:13Z", null, null, "0") is "2010-02-10T20:13Z"39 PASS stepDown("2010-02-10T20:13Z", null, null, "0") is "2010-02-10T20:13Z"40 PASS stepUp("2010-02-10T20:13Z", null, null, "foo") is "2010-02-10T20:13Z"41 PASS stepDown("2010-02-10T20:13Z", null, null, "foo") is "2010-02-10T20:13Z"42 PASS stepUp("2010-02-10T20:13Z", null, null, null) is "2010-02-10T20:13Z"43 PASS stepDown("2010-02-10T20:13Z", null, null, null) is "2010-02-10T20:13Z"44 Normal cases45 PASS stepUp("2010-02-10T20:13Z", null, null) is "2010-02-10T20:14Z"46 PASS stepDown("2010-02-10T20:13Z", null, null) is "2010-02-10T20:12Z"47 PASS stepUp("2010-02-10T20:13Z", null, null, 10) is "2010-02-10T20:23Z"48 PASS stepDown("2010-02-10T20:13Z", null, null, 11) is "2010-02-10T20:02Z"49 PASS stepUp("1970-01-01T20:13Z", "4", null, 2) is "1970-01-01T20:13:08Z"50 PASS stepDown("1970-01-01T20:13Z", "4", null, 3) is "1970-01-01T20:12:48Z"51 Step=any52 PASS stepUp("2010-02-10T20:13Z", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.53 PASS stepDown("2010-02-10T20:13Z", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.54 Overflow/underflow55 PASS stepUp("2010-02-10T20:13Z", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.56 PASS stepDown("2010-02-10T20:13Z", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.57 PASS stepUp("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.58 PASS stepDown("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.59 60 Datetime-local type61 Invalid value62 PASS stepUp("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.63 PASS stepDown("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.64 Non-number arguments65 PASS stepUp("2010-02-10T20:13", null, null, "0") is "2010-02-10T20:13"66 PASS stepDown("2010-02-10T20:13", null, null, "0") is "2010-02-10T20:13"67 PASS stepUp("2010-02-10T20:13", null, null, "foo") is "2010-02-10T20:13"68 PASS stepDown("2010-02-10T20:13", null, null, "foo") is "2010-02-10T20:13"69 PASS stepUp("2010-02-10T20:13", null, null, null) is "2010-02-10T20:13"70 PASS stepDown("2010-02-10T20:13", null, null, null) is "2010-02-10T20:13"71 Normal cases72 PASS stepUp("2010-02-10T20:13", null, null) is "2010-02-10T20:14"73 PASS stepDown("2010-02-10T20:13", null, null) is "2010-02-10T20:12"74 PASS stepUp("2010-02-10T20:13", null, null, 10) is "2010-02-10T20:23"75 PASS stepDown("2010-02-10T20:13", null, null, 11) is "2010-02-10T20:02"76 PASS stepUp("1970-01-01T20:13", "4", null, 2) is "1970-01-01T20:13:08"77 PASS stepDown("1970-01-01T20:13", "4", null, 3) is "1970-01-01T20:12:48"78 Step=any79 PASS stepUp("2010-02-10T20:13", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.80 PASS stepDown("2010-02-10T20:13", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.81 Overflow/underflow82 PASS stepUp("2010-02-10T20:13", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.83 PASS stepDown("2010-02-10T20:13", "3.40282346e+38", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.84 PASS stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.85 PASS stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.86 87 Number type88 Invalid value89 PASS stepUp("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.90 PASS stepDown("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.91 Non-number arguments92 PASS stepUp("0", null, null, "0") is "0"93 PASS stepDown("0", null, null, "0") is "0"94 PASS stepUp("0", null, null, "foo") is "0"95 PASS stepDown("0", null, null, "foo") is "0"96 PASS stepUp("0", null, null, null) is "0"97 PASS stepDown("0", null, null, null) is "0"98 Normal cases99 PASS stepUp("0", null, null) is "1"100 PASS stepUp("1", null, null, 2) is "3"101 PASS stepUp("3", null, null, -1) is "2"102 PASS stepDown("2", null, null) is "1"103 PASS stepDown("1", null, null, 2) is "-1"104 PASS stepDown("-1", null, null, -1) is "0"105 Extra arguments106 PASS input.value = "0"; input.min = null; input.step = null; input.stepUp(1, 2); input.value is "1"107 PASS input.value = "1"; input.stepDown(1, 3); input.value is "0"108 Invalid step value109 PASS stepUp("0", "foo", null) is "1"110 PASS stepUp("1", "0", null) is "2"111 PASS stepUp("2", "-1", null) is "3"112 Step=any113 PASS stepUp("0", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.114 PASS stepDown("0", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.115 Step=any corner case116 PASS stepUpExplicitBounds("0", "100", "any", "1.5", "1") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.117 PASS stepDownExplicitBounds("0", "100", "any", "1.5", "1") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.118 Overflow/underflow119 PASS stepDown("1", "1", "0") is "0"120 PASS stepDown("0", "1", "0") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.121 PASS stepDown("1", "1", "0", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.122 PASS input.value is "1"123 PASS stepDown("1", "3.40282346e+38", "", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.124 PASS stepUp("-1", "1", "0") is "0"125 PASS stepUp("0", "1", "0") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.126 PASS stepUp("-1", "1", "0", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.127 PASS input.value is "-1"128 PASS stepUp("1", "3.40282346e+38", "", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.129 stepDown()/stepUp() for stepMismatch values130 PASS stepUp("1", "2", "") is "3"131 PASS input.stepDown(); input.value is "1"132 PASS input.min = "0"; stepUp("9", "10", "", 9) is "99"133 PASS stepDown("19", "10", "0") is "9"134 PASS stepUp("89", "10", "99") is "99"135 Huge value and small step136 PASS input.min = ""; stepUp("1e+38", "1", "", 999999) is "1e+38"137 PASS input.max = ""; stepDown("1e+38", "1", "", 999999) is "1e+38"138 Fractional numbers139 PASS input.min = ""; stepUp("0", "0.33333333333333333", "", 3) is "1"140 PASS stepUp("1", "0.1", "", 10) is "2"141 PASS input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.value is "3"142 PASS input.min = "0"; stepUp("0", "0.003921568627450980", "1", 255) is "1"143 PASS for (var i = 0; i < 255; i++) { input.stepDown(); }; input.value is "0"144 Rounding145 PASS stepUp("5.005", "0.005", "", 2) is "5.015"146 PASS stepUp("5.005", "0.005", "", 11) is "5.06"147 PASS stepUp("5.005", "0.005", "", 12) is "5.065"148 PASS stepUpExplicitBounds("4", "9", "0.005", "5.005", 2) is "5.015"149 PASS stepUpExplicitBounds("4", "9", "0.005", "5.005", 11) is "5.06"150 PASS stepUpExplicitBounds("4", "9", "0.005", "5.005", 12) is "5.065"151 152 Range type153 function arguments are (min, max, step, value, [stepCount])154 Using the default values155 PASS stepUpExplicitBounds(null, null, null, "") is "51"156 PASS stepDownExplicitBounds(null, null, null, "") is "49"157 Non-number arguments (stepCount)158 PASS stepUpExplicitBounds(null, null, null, "0", "0") is "0"159 PASS stepDownExplicitBounds(null, null, null, "0", "0") is "0"160 PASS stepUpExplicitBounds(null, null, null, "0", "foo") is "0"161 PASS stepDownExplicitBounds(null, null, null, "0", "foo") is "0"162 PASS stepUpExplicitBounds(null, null, null, "0", null) is "0"163 PASS stepDownExplicitBounds(null, null, null, "0", null) is "0"164 Normal cases165 PASS stepUpExplicitBounds(null, null, null, "0") is "1"166 PASS stepUpExplicitBounds(null, null, null, "1", 2) is "3"167 PASS stepUpExplicitBounds(null, null, null, "3", -1) is "2"168 PASS stepDownExplicitBounds("-100", null, null, "2") is "1"169 PASS stepDownExplicitBounds("-100", null, null, "1", 2) is "-1"170 PASS stepDownExplicitBounds("-100", null, null, "-1", -1) is "0"171 Extra arguments172 PASS setInputAttributes(null, null, null, "0"); input.stepUp(1,2); input.value is "1"173 PASS setInputAttributes(null, null, null, "1"); input.stepDown(1,3); input.value is "0"174 Invalid step value175 PASS stepUpExplicitBounds(null, null, "foo", "0") is "1"176 PASS stepUpExplicitBounds(null, null, "0", "1") is "2"177 PASS stepUpExplicitBounds(null, null, "-1", "2") is "3"178 PASS stepDownExplicitBounds(null, null, "foo", "1") is "0"179 PASS stepDownExplicitBounds(null, null, "0", "2") is "1"180 PASS stepDownExplicitBounds(null, null, "-1", "3") is "2"181 Step=any182 PASS stepUpExplicitBounds(null, null, "any", "1") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.183 PASS stepDownExplicitBounds(null, null, "any", "1") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.184 Overflow/underflow185 PASS stepUpExplicitBounds(null, "100", "1", "99") is "100"186 PASS stepUpExplicitBounds(null, "100", "1", "100") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.187 PASS input.value is "100"188 PASS stepUpExplicitBounds(null, "100", "1", "99", "2") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.189 PASS input.value is "99"190 PASS stepDownExplicitBounds("0", null, "1", "1") is "0"191 PASS stepDownExplicitBounds("0", null, "1", "0") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.192 PASS input.value is "0"193 PASS stepDownExplicitBounds("0", null, "1", "1", "2") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.194 PASS input.value is "1"195 PASS stepDownExplicitBounds(null, null, "3.40282346e+38", "1", "2") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.196 PASS stepUpExplicitBounds(-100, 0, 1, -1) is "0"197 PASS stepUpExplicitBounds(null, 0, 1, 0) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.198 PASS stepUpExplicitBounds(-100, 0, 1, -1, 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.199 PASS input.value is "-1"200 PASS stepUpExplicitBounds(null, null, "3.40282346e+38", "1", "2") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.201 stepDown()/stepUp() for stepMismatch values202 PASS stepUpExplicitBounds(null, null, 2, 1) is "4"203 PASS input.stepDown(); input.value is "2"204 PASS stepUpExplicitBounds(0, null, 10, 9, 9) is "100"205 PASS stepDownExplicitBounds(0, null, 10, 19) is "10"206 value + step is <= max, but rounded result would be > max.207 PASS stepUpExplicitBounds(null, 99, 10, 89) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.208 Huge value and small step209 PASS stepUpExplicitBounds(0, 1e38, 1, 1e38, 999999) is "1e+38"210 PASS stepDownExplicitBounds(0, 1e38, 1, 1e38, 999999) is "1e+38"211 Fractional numbers212 PASS stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3) is "1"213 PASS stepUpExplicitBounds(null, null, 0.1, 1) is "1.1"214 PASS stepUpExplicitBounds(null, null, 0.1, 1, 8) is "1.8"215 PASS stepUpExplicitBounds(null, null, 0.1, 1, 10) is "2"216 PASS input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.value is "3"217 PASS stepUpExplicitBounds(0, 1, 0.003921568627450980, 0, 255) is "1"218 PASS for (var i = 0; i < 255; i++) { input.stepDown(); }; input.value is "0"219 PASS stepDownExplicitBounds(null, null, 0.1, 1, 8) is "0.2"220 PASS stepDownExplicitBounds(null, null, 0.1, 1) is "0.9"221 222 Time type223 6 Invalid value 224 7 PASS stepUp("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. … … 249 32 PASS stepDown("00:00", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 250 33 251 Unsupported type252 PASS input.step = "3"; input.min = ""; input.max = ""; input.value = "2"; input.stepDown() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.253 PASS input.stepDown(0) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.254 PASS input.stepUp() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.255 PASS input.stepUp(0) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.256 34 PASS successfullyParsed is true 257 35 -
trunk/LayoutTests/fast/forms/time/time-stepup-stepdown-from-renderer-expected.txt
r92745 r92746 1 Check stepping-up and -down for from renderer. No cases of empty initial values for type=date, datetime, datetime-local, time.1 Check stepping-up and -down for time input fields from renderer. No cases of empty initial values. 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 Date type7 Function arguments are (value, step, {min or max}, [stepCount]).8 Normal cases9 PASS stepUp("2010-02-10", null, null) is "2010-02-11"10 PASS stepDown("2010-02-10", null, null) is "2010-02-09"11 PASS stepUp("2010-02-10", null, null, 10) is "2010-02-20"12 PASS stepDown("2010-02-10", null, null, 11) is "2010-01-30"13 PASS stepUp("1970-01-01", "4", null, 2) is "1970-01-09"14 PASS stepDown("1970-01-01", "4", null, 3) is "1969-12-20"15 Step=any16 PASS stepUp("2010-02-10", "any", null) is "2010-02-11"17 PASS stepDown("2010-02-10", "any", null) is "2010-02-09"18 Overflow/underflow19 PASS stepUp("2010-02-10", "3.40282346e+38", null) is "275760-09-13"20 PASS stepDown("2010-02-10", "3.40282346e+38", null) is "1970-01-01"21 PASS stepUp("2010-02-10", "1", "2010-02-10") is "2010-02-10"22 PASS stepDown("2010-02-10", "1", "2010-02-10") is "2010-02-10"23 stepDown()/stepUp() for stepMismatch values24 PASS stepDown("2010-02-10", "3", "2010-02-06") is "2010-02-09"25 PASS stepUp("1970-01-02", "2", "") is "1970-01-03"26 27 Datetime type28 Function arguments are (value, step, {min or max}, [stepCount]).29 Normal cases30 PASS stepUp("2010-02-10T20:13Z", null, null) is "2010-02-10T20:14Z"31 PASS stepDown("2010-02-10T20:13Z", null, null) is "2010-02-10T20:12Z"32 PASS stepUp("2010-02-10T20:13Z", null, null, 10) is "2010-02-10T20:23Z"33 PASS stepDown("2010-02-10T20:13Z", null, null, 11) is "2010-02-10T20:02Z"34 PASS stepUp("1970-01-01T20:13Z", "4", null, 2) is "1970-01-01T20:13:08Z"35 PASS stepDown("1970-01-01T20:13Z", "4", null, 3) is "1970-01-01T20:12:48Z"36 Step=any37 PASS stepUp("2010-02-10T20:13Z", "any", null) is "2010-02-10T20:14Z"38 PASS stepDown("2010-02-10T20:13Z", "any", null) is "2010-02-10T20:12Z"39 Overflow/underflow40 PASS stepUp("2010-02-10T20:13Z", "3.40282346e+38", null) is "275760-09-13T00:00:00.000Z"41 PASS stepDown("2010-02-10T20:13Z", "3.40282346e+38", null) is "1970-01-01T00:00:00.000Z"42 PASS stepUp("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z") is "2010-02-10T20:13Z"43 PASS stepDown("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z") is "2010-02-10T20:13Z"44 stepDown()/stepUp() for stepMismatch values45 PASS stepDown("2010-02-10T20:13Z", "3", "2010-02-10T20:12:56Z") is "2010-02-10T20:12:59Z"46 PASS stepUp("1970-01-01T00:13Z", "7", "") is "1970-01-01T00:13:04Z"47 48 Datetime-local type49 Function arguments are (value, step, {min or max}, [stepCount]).50 Normal cases51 PASS stepUp("2010-02-10T20:13", null, null) is "2010-02-10T20:14"52 PASS stepDown("2010-02-10T20:13", null, null) is "2010-02-10T20:12"53 PASS stepUp("2010-02-10T20:13", null, null, 10) is "2010-02-10T20:23"54 PASS stepDown("2010-02-10T20:13", null, null, 11) is "2010-02-10T20:02"55 PASS stepUp("1970-01-01T20:13", "4", null, 2) is "1970-01-01T20:13:08"56 PASS stepDown("1970-01-01T20:13", "4", null, 3) is "1970-01-01T20:12:48"57 Step=any58 PASS stepUp("2010-02-10T20:13", "any", null) is "2010-02-10T20:14"59 PASS stepDown("2010-02-10T20:13", "any", null) is "2010-02-10T20:12"60 Overflow/underflow61 PASS stepUp("2010-02-10T20:13", "3.40282346e+38", null) is "275760-09-13T00:00:00.000"62 PASS stepDown("2010-02-10T20:13", "3.40282346e+38", null) is "1970-01-01T00:00:00.000"63 PASS stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13") is "2010-02-10T20:13"64 PASS stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13") is "2010-02-10T20:13"65 stepDown()/stepUp() for stepMismatch values66 PASS stepDown("2010-02-10T20:13", "3", "2010-02-10T20:12:56") is "2010-02-10T20:12:59"67 PASS stepUp("1970-01-01T00:13", "7", "") is "1970-01-01T00:13:04"68 69 Number type70 Function arguments are (value, step, {min or max}, [stepCount]).71 Invalid value72 PASS stepUp("", null, null) is "1"73 PASS stepDown("", null, null) is "-1"74 PASS stepUp("", "any", null) is "1"75 PASS stepDown("", "any", null) is "-1"76 PASS stepUp("", "foo", null) is "1"77 PASS stepDown("", "foo", null) is "-1"78 PASS stepUp("foo", null, null) is "1"79 PASS stepDown("foo", null, null) is "-1"80 PASS stepUp("foo", "any", null) is "1"81 PASS stepDown("foo", "any", null) is "-1"82 PASS stepUp("foo", "foo", null) is "1"83 PASS stepDown("foo", "foo", null) is "-1"84 Normal cases85 PASS stepUp("0", null, null) is "1"86 PASS stepUp("1", null, null, 2) is "3"87 PASS stepUp("3", null, null, -1) is "2"88 PASS stepDown("2", null, null) is "1"89 PASS stepDown("1", null, null, 2) is "-1"90 PASS stepDown("-1", null, null, -1) is "0"91 Invalid step value92 PASS stepUp("0", "foo", null) is "1"93 PASS stepUp("1", "0", null) is "2"94 PASS stepUp("2", "-1", null) is "3"95 Step=any96 PASS stepUp("0", "any", null) is "1"97 PASS stepDown("0", "any", null) is "-1"98 Step=any corner case99 PASS stepUpExplicitBounds("0", "100", "any", "1.5", "1") is "2.5"100 PASS stepDownExplicitBounds("0", "100", "any", "1.5", "1") is "0.5"101 Overflow/underflow102 PASS stepDown("1", "1", "0") is "0"103 PASS stepDown("0", "1", "0") is "0"104 PASS stepDown("1", "1", "0", 2) is "0"105 PASS stepDown("1", "3.40282346e+38", "", 2) is "-3.40282346e+38"106 PASS stepUp("-1", "1", "0") is "0"107 PASS stepUp("0", "1", "0") is "0"108 PASS stepUp("-1", "1", "0", 2) is "0"109 PASS stepUp("1", "3.40282346e+38", "", 2) is "3.40282346e+38"110 stepDown()/stepUp() for stepMismatch values111 PASS stepUp("1", "2", "") is "2"112 PASS input.min = "0"; stepUp("9", "10", "") is "10"113 PASS stepDown("19", "10", "0") is "10"114 PASS stepUp("89", "10", "99") is "90"115 Huge value and small step116 PASS input.min = ""; stepUp("1e+38", "1", "", 999) is "1e+38"117 PASS input.max = ""; stepDown("1e+38", "1", "", 999) is "1e+38"118 Fractional numbers119 PASS input.min = ""; stepUp("0", "0.33333333333333333", "", 3) is "1"120 PASS stepUp("1", "0.1", "", 10) is "2"121 PASS input.min = "0"; stepUp("0", "0.003921568627450980", "1", 255) is "1"122 Rounding123 PASS stepUp("5.005", "0.005", "", 2) is "5.015"124 PASS stepUp("5.005", "0.005", "", 11) is "5.06"125 PASS stepUp("5.005", "0.005", "", 12) is "5.065"126 PASS stepUpExplicitBounds("4", "9", "0.005", "5.005", 2) is "5.015"127 PASS stepUpExplicitBounds("4", "9", "0.005", "5.005", 11) is "5.06"128 PASS stepUpExplicitBounds("4", "9", "0.005", "5.005", 12) is "5.065"129 PASS stepUpExplicitBounds(-4, 4, 1, "") is "1"130 PASS stepDownExplicitBounds(-4, 4, 1, "") is "-1"131 PASS stepDownExplicitBounds(0, 4, 1, "") is "0"132 PASS stepUpExplicitBounds(-4, 0, 1, "") is "0"133 PASS stepDownExplicitBounds(1, 4, 1, "") is "1"134 PASS stepUpExplicitBounds(1, 4, 1, "") is "1"135 PASS stepDownExplicitBounds(-4, -1, 1, "") is "-1"136 PASS stepUpExplicitBounds(-4, -1, 1, "") is "-1"137 PASS stepUpExplicitBounds(-100, null, 3, "") is "2"138 PASS stepDownExplicitBounds(-100, null, 3, "") is "-1"139 PASS stepUpExplicitBounds(1, 4, 1, 0) is "1"140 PASS stepDownExplicitBounds(1, 4, 1, 0) is "0"141 PASS stepDownExplicitBounds(-4, -1, 1, 0) is "-1"142 PASS stepUpExplicitBounds(-4, -1, 1, 0) is "0"143 PASS stepUpExplicitBounds(-100, null, 3, 3) is "5"144 PASS stepDownExplicitBounds(-100, null, 3, 3) is "2"145 146 Range type147 Function arguments are (min, max, step, value, [stepCount]).148 Using the default values149 PASS stepUpExplicitBounds(null, null, null, "") is "51"150 PASS stepDownExplicitBounds(null, null, null, "") is "49"151 PASS stepUpExplicitBounds(null, null, "any", "") is "51"152 PASS stepDownExplicitBounds(null, null, "any", "") is "49"153 PASS stepUpExplicitBounds(null, null, "foo", "") is "51"154 PASS stepDownExplicitBounds(null, null, "foo", "") is "49"155 PASS stepUpExplicitBounds(null, null, null, "foo") is "51"156 PASS stepDownExplicitBounds(null, null, null, "foo") is "49"157 PASS stepUpExplicitBounds(null, null, "any", "foo") is "51"158 PASS stepDownExplicitBounds(null, null, "any", "foo") is "49"159 PASS stepUpExplicitBounds(null, null, "foo", "foo") is "51"160 PASS stepDownExplicitBounds(null, null, "foo", "foo") is "49"161 Normal cases162 PASS stepUpExplicitBounds(null, null, null, "0") is "1"163 PASS stepUpExplicitBounds(null, null, null, "1", 2) is "3"164 PASS stepUpExplicitBounds(null, null, null, "3", -1) is "2"165 PASS stepDownExplicitBounds("-100", null, null, "2") is "1"166 PASS stepDownExplicitBounds("-100", null, null, "1", 2) is "-1"167 PASS stepDownExplicitBounds("-100", null, null, "-1", -1) is "0"168 Invalid step value169 PASS stepUpExplicitBounds(null, null, "foo", "0") is "1"170 PASS stepUpExplicitBounds(null, null, "0", "1") is "2"171 PASS stepUpExplicitBounds(null, null, "-1", "2") is "3"172 PASS stepDownExplicitBounds(null, null, "foo", "1") is "0"173 PASS stepDownExplicitBounds(null, null, "0", "2") is "1"174 PASS stepDownExplicitBounds(null, null, "-1", "3") is "2"175 Step=any176 PASS stepUpExplicitBounds(null, null, "any", "1") is "2"177 PASS stepDownExplicitBounds(null, null, "any", "1") is "0"178 Overflow/underflow179 PASS stepUpExplicitBounds(null, "100", "1", "99") is "100"180 PASS stepUpExplicitBounds(null, "100", "1", "100") is "100"181 PASS stepUpExplicitBounds(null, "100", "1", "99", 2) is "100"182 PASS stepDownExplicitBounds("0", null, "1", "1") is "0"183 PASS stepDownExplicitBounds("0", null, "1", "0") is "0"184 PASS stepDownExplicitBounds("0", null, "1", "1", 2) is "0"185 PASS stepDownExplicitBounds(null, null, "3.40282346e+38", "1", 2) is "0"186 PASS stepUpExplicitBounds(-100, 0, 1, -1) is "0"187 PASS stepUpExplicitBounds(null, 0, 1, 0) is "0"188 PASS stepUpExplicitBounds(-100, 0, 1, -1, 2) is "0"189 PASS stepUpExplicitBounds(null, null, "3.40282346e+38", "1", 2) is "0"190 stepDown()/stepUp() for stepMismatch values191 PASS stepUpExplicitBounds(null, null, 2, 1) is "4"192 PASS stepUpExplicitBounds(0, null, 10, 9, 9) is "100"193 PASS stepDownExplicitBounds(0, null, 10, 19) is "10"194 value + step is <= max, but rounded result would be > max.195 PASS stepUpExplicitBounds(null, 99, 10, 89) is "90"196 Huge value and small step197 PASS stepUpExplicitBounds(0, 1e38, 1, 1e38, 999) is "1e+38"198 PASS stepDownExplicitBounds(0, 1e38, 1, 1e38, 999) is "1e+38"199 Fractional numbers200 PASS stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3) is "1"201 PASS stepUpExplicitBounds(null, null, 0.1, 1) is "1.1"202 PASS stepUpExplicitBounds(null, null, 0.1, 1, 8) is "1.8"203 PASS stepUpExplicitBounds(null, null, 0.1, 1, 10) is "2"204 PASS stepUpExplicitBounds(0, 1, 0.003921568627450980, 0, 255) is "1"205 PASS stepDownExplicitBounds(null, null, 0.1, 1, 8) is "0.2"206 PASS stepDownExplicitBounds(null, null, 0.1, 1) is "0.9"207 208 Time type209 6 Function arguments are (value, step, {min or max}, [stepCount]). 210 7 Normal cases -
trunk/LayoutTests/fast/forms/time/time-stepup-stepdown-from-renderer.html
r92745 r92746 1 description('Check stepping-up and -down for <input> from renderer. No cases of empty initial values for type=date, datetime, datetime-local, time.'); 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <link rel="stylesheet" href="../../js/resources/js-test-style.css"> 5 <script src="../../js/resources/js-test-pre.js"></script> 6 </head> 7 <body> 8 <p id="description"></p> 9 <div id="console"></div> 10 <script> 11 description('Check stepping-up and -down for time input fields from renderer. No cases of empty initial values.'); 2 12 3 13 var input = document.createElement('input'); … … 45 55 } 46 56 47 // Range value gets automatically shifted based on bounds,48 // So always set the min and max first to get expected behavior49 50 function stepUpExplicitBounds(min, max, step, value, stepCount) {51 setInputAttributes(min, max, step, value);52 if (typeof stepCount !== 'undefined')53 if (stepCount < 0) {54 for (var i = 0; i < -stepCount; i++)55 sendKey('Down');56 } else {57 for (var i = 0; i < stepCount; i++)58 sendKey('Up');59 }60 else61 sendKey('Up');62 return input.value;63 }64 65 function stepDownExplicitBounds(min, max, step, value, stepCount) {66 setInputAttributes(min, max, step, value);67 if (typeof stepCount !== 'undefined')68 if (stepCount < 0) {69 for (var i = 0; i < -stepCount; i++)70 sendKey('Up');71 } else {72 for (var i = 0; i < stepCount; i++)73 sendKey('Down');74 }75 else76 sendKey('Down');77 return input.value;78 }79 80 debug('Date type');81 input.type = 'date';82 debug('Function arguments are (value, step, {min or max}, [stepCount]).');83 debug('Normal cases');84 shouldBe('stepUp("2010-02-10", null, null)', '"2010-02-11"');85 shouldBe('stepDown("2010-02-10", null, null)', '"2010-02-09"');86 shouldBe('stepUp("2010-02-10", null, null, 10)', '"2010-02-20"');87 shouldBe('stepDown("2010-02-10", null, null, 11)', '"2010-01-30"');88 shouldBe('stepUp("1970-01-01", "4", null, 2)', '"1970-01-09"');89 shouldBe('stepDown("1970-01-01", "4", null, 3)', '"1969-12-20"');90 debug('Step=any');91 shouldBe('stepUp("2010-02-10", "any", null)', '"2010-02-11"');92 shouldBe('stepDown("2010-02-10", "any", null)', '"2010-02-09"');93 debug('Overflow/underflow');94 shouldBe('stepUp("2010-02-10", "3.40282346e+38", null)','"275760-09-13"');95 shouldBe('stepDown("2010-02-10", "3.40282346e+38", null)', '"1970-01-01"');96 shouldBe('stepUp("2010-02-10", "1", "2010-02-10")', '"2010-02-10"');97 shouldBe('stepDown("2010-02-10", "1", "2010-02-10")', '"2010-02-10"');98 debug('stepDown()/stepUp() for stepMismatch values');99 shouldBe('stepDown("2010-02-10", "3", "2010-02-06")', '"2010-02-09"');100 shouldBe('stepUp("1970-01-02", "2", "")', '"1970-01-03"');101 102 debug('');103 debug('Datetime type');104 input.type = 'datetime';105 debug('Function arguments are (value, step, {min or max}, [stepCount]).');106 debug('Normal cases');107 shouldBe('stepUp("2010-02-10T20:13Z", null, null)', '"2010-02-10T20:14Z"');108 shouldBe('stepDown("2010-02-10T20:13Z", null, null)', '"2010-02-10T20:12Z"');109 shouldBe('stepUp("2010-02-10T20:13Z", null, null, 10)', '"2010-02-10T20:23Z"');110 shouldBe('stepDown("2010-02-10T20:13Z", null, null, 11)', '"2010-02-10T20:02Z"');111 shouldBe('stepUp("1970-01-01T20:13Z", "4", null, 2)', '"1970-01-01T20:13:08Z"');112 shouldBe('stepDown("1970-01-01T20:13Z", "4", null, 3)', '"1970-01-01T20:12:48Z"');113 debug('Step=any');114 shouldBe('stepUp("2010-02-10T20:13Z", "any", null)', '"2010-02-10T20:14Z"');115 shouldBe('stepDown("2010-02-10T20:13Z", "any", null)', '"2010-02-10T20:12Z"');116 debug('Overflow/underflow');117 shouldBe('stepUp("2010-02-10T20:13Z", "3.40282346e+38", null)', '"275760-09-13T00:00:00.000Z"');118 shouldBe('stepDown("2010-02-10T20:13Z", "3.40282346e+38", null)', '"1970-01-01T00:00:00.000Z"');119 shouldBe('stepUp("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z")', '"2010-02-10T20:13Z"');120 shouldBe('stepDown("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z")', '"2010-02-10T20:13Z"');121 debug('stepDown()/stepUp() for stepMismatch values');122 shouldBe('stepDown("2010-02-10T20:13Z", "3", "2010-02-10T20:12:56Z")', '"2010-02-10T20:12:59Z"');123 shouldBe('stepUp("1970-01-01T00:13Z", "7", "")', '"1970-01-01T00:13:04Z"');124 125 debug('');126 debug('Datetime-local type');127 input.type = 'datetime-local';128 debug('Function arguments are (value, step, {min or max}, [stepCount]).');129 debug('Normal cases');130 shouldBe('stepUp("2010-02-10T20:13", null, null)', '"2010-02-10T20:14"');131 shouldBe('stepDown("2010-02-10T20:13", null, null)', '"2010-02-10T20:12"');132 shouldBe('stepUp("2010-02-10T20:13", null, null, 10)', '"2010-02-10T20:23"');133 shouldBe('stepDown("2010-02-10T20:13", null, null, 11)', '"2010-02-10T20:02"');134 shouldBe('stepUp("1970-01-01T20:13", "4", null, 2)', '"1970-01-01T20:13:08"');135 shouldBe('stepDown("1970-01-01T20:13", "4", null, 3)', '"1970-01-01T20:12:48"');136 debug('Step=any');137 shouldBe('stepUp("2010-02-10T20:13", "any", null)', '"2010-02-10T20:14"');138 shouldBe('stepDown("2010-02-10T20:13", "any", null)', '"2010-02-10T20:12"');139 debug('Overflow/underflow');140 shouldBe('stepUp("2010-02-10T20:13", "3.40282346e+38", null)', '"275760-09-13T00:00:00.000"');141 shouldBe('stepDown("2010-02-10T20:13", "3.40282346e+38", null)', '"1970-01-01T00:00:00.000"');142 shouldBe('stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13")', '"2010-02-10T20:13"');143 shouldBe('stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13")', '"2010-02-10T20:13"');144 debug('stepDown()/stepUp() for stepMismatch values');145 shouldBe('stepDown("2010-02-10T20:13", "3", "2010-02-10T20:12:56")', '"2010-02-10T20:12:59"');146 shouldBe('stepUp("1970-01-01T00:13", "7", "")', '"1970-01-01T00:13:04"');147 148 debug('');149 debug('Number type');150 input.type = 'number';151 debug('Function arguments are (value, step, {min or max}, [stepCount]).');152 debug('Invalid value');153 shouldBe('stepUp("", null, null)', '"1"');154 shouldBe('stepDown("", null, null)', '"-1"');155 shouldBe('stepUp("", "any", null)', '"1"');156 shouldBe('stepDown("", "any", null)', '"-1"');157 shouldBe('stepUp("", "foo", null)', '"1"');158 shouldBe('stepDown("", "foo", null)', '"-1"');159 shouldBe('stepUp("foo", null, null)', '"1"');160 shouldBe('stepDown("foo", null, null)', '"-1"');161 shouldBe('stepUp("foo", "any", null)', '"1"');162 shouldBe('stepDown("foo", "any", null)', '"-1"');163 shouldBe('stepUp("foo", "foo", null)', '"1"');164 shouldBe('stepDown("foo", "foo", null)', '"-1"');165 debug('Normal cases');166 shouldBe('stepUp("0", null, null)', '"1"');167 shouldBe('stepUp("1", null, null, 2)', '"3"');168 shouldBe('stepUp("3", null, null, -1)', '"2"');169 shouldBe('stepDown("2", null, null)', '"1"');170 shouldBe('stepDown("1", null, null, 2)', '"-1"');171 shouldBe('stepDown("-1", null, null, -1)', '"0"');172 debug('Invalid step value');173 shouldBe('stepUp("0", "foo", null)', '"1"');174 shouldBe('stepUp("1", "0", null)', '"2"');175 shouldBe('stepUp("2", "-1", null)', '"3"');176 debug('Step=any');177 shouldBe('stepUp("0", "any", null)', '"1"');178 shouldBe('stepDown("0", "any", null)', '"-1"');179 debug('Step=any corner case');180 shouldBe('stepUpExplicitBounds("0", "100", "any", "1.5", "1")', '"2.5"');181 shouldBe('stepDownExplicitBounds("0", "100", "any", "1.5", "1")', '"0.5"');182 debug('Overflow/underflow');183 shouldBe('stepDown("1", "1", "0")', '"0"');184 shouldBe('stepDown("0", "1", "0")', '"0"');185 shouldBe('stepDown("1", "1", "0", 2)', '"0"');186 shouldBe('stepDown("1", "3.40282346e+38", "", 2)', '"-3.40282346e+38"');187 shouldBe('stepUp("-1", "1", "0")', '"0"');188 shouldBe('stepUp("0", "1", "0")', '"0"');189 shouldBe('stepUp("-1", "1", "0", 2)', '"0"');190 shouldBe('stepUp("1", "3.40282346e+38", "", 2)', '"3.40282346e+38"');191 debug('stepDown()/stepUp() for stepMismatch values');192 shouldBe('stepUp("1", "2", "")', '"2"');193 shouldBe('input.min = "0"; stepUp("9", "10", "")', '"10"');194 shouldBe('stepDown("19", "10", "0")', '"10"');195 shouldBe('stepUp("89", "10", "99")', '"90"');196 debug('Huge value and small step');197 shouldBe('input.min = ""; stepUp("1e+38", "1", "", 999)', '"1e+38"');198 shouldBe('input.max = ""; stepDown("1e+38", "1", "", 999)', '"1e+38"');199 debug('Fractional numbers');200 shouldBe('input.min = ""; stepUp("0", "0.33333333333333333", "", 3)', '"1"');201 shouldBe('stepUp("1", "0.1", "", 10)', '"2"');202 shouldBe('input.min = "0"; stepUp("0", "0.003921568627450980", "1", 255)', '"1"');203 debug('Rounding');204 shouldBe('stepUp("5.005", "0.005", "", 2)', '"5.015"');205 shouldBe('stepUp("5.005", "0.005", "", 11)', '"5.06"');206 shouldBe('stepUp("5.005", "0.005", "", 12)', '"5.065"');207 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 2)', '"5.015"');208 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 11)', '"5.06"');209 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 12)', '"5.065"');210 shouldBe('stepUpExplicitBounds(-4, 4, 1, "")', '"1"');211 shouldBe('stepDownExplicitBounds(-4, 4, 1, "")', '"-1"');212 shouldBe('stepDownExplicitBounds(0, 4, 1, "")', '"0"');213 shouldBe('stepUpExplicitBounds(-4, 0, 1, "")', '"0"');214 shouldBe('stepDownExplicitBounds(1, 4, 1, "")', '"1"');215 shouldBe('stepUpExplicitBounds(1, 4, 1, "")', '"1"');216 shouldBe('stepDownExplicitBounds(-4, -1, 1, "")', '"-1"');217 shouldBe('stepUpExplicitBounds(-4, -1, 1, "")', '"-1"');218 shouldBe('stepUpExplicitBounds(-100, null, 3, "")', '"2"');219 shouldBe('stepDownExplicitBounds(-100, null, 3, "")', '"-1"');220 shouldBe('stepUpExplicitBounds(1, 4, 1, 0)', '"1"');221 shouldBe('stepDownExplicitBounds(1, 4, 1, 0)', '"0"');222 shouldBe('stepDownExplicitBounds(-4, -1, 1, 0)', '"-1"');223 shouldBe('stepUpExplicitBounds(-4, -1, 1, 0)', '"0"');224 shouldBe('stepUpExplicitBounds(-100, null, 3, 3)', '"5"');225 shouldBe('stepDownExplicitBounds(-100, null, 3, 3)', '"2"');226 227 debug('');228 debug('Range type');229 input.type = 'range';230 debug('Function arguments are (min, max, step, value, [stepCount]).');231 debug('Using the default values');232 shouldBe('stepUpExplicitBounds(null, null, null, "")', '"51"');233 shouldBe('stepDownExplicitBounds(null, null, null, "")', '"49"');234 shouldBe('stepUpExplicitBounds(null, null, "any", "")', '"51"');235 shouldBe('stepDownExplicitBounds(null, null, "any", "")', '"49"');236 shouldBe('stepUpExplicitBounds(null, null, "foo", "")', '"51"');237 shouldBe('stepDownExplicitBounds(null, null, "foo", "")', '"49"');238 shouldBe('stepUpExplicitBounds(null, null, null, "foo")', '"51"');239 shouldBe('stepDownExplicitBounds(null, null, null, "foo")', '"49"');240 shouldBe('stepUpExplicitBounds(null, null, "any", "foo")', '"51"');241 shouldBe('stepDownExplicitBounds(null, null, "any", "foo")', '"49"');242 shouldBe('stepUpExplicitBounds(null, null, "foo", "foo")', '"51"');243 shouldBe('stepDownExplicitBounds(null, null, "foo", "foo")', '"49"');244 debug('Normal cases');245 shouldBe('stepUpExplicitBounds(null, null, null, "0")', '"1"');246 shouldBe('stepUpExplicitBounds(null, null, null, "1", 2)', '"3"');247 shouldBe('stepUpExplicitBounds(null, null, null, "3", -1)', '"2"');248 shouldBe('stepDownExplicitBounds("-100", null, null, "2")', '"1"');249 shouldBe('stepDownExplicitBounds("-100", null, null, "1", 2)', '"-1"');250 shouldBe('stepDownExplicitBounds("-100", null, null, "-1", -1)', '"0"');251 debug('Invalid step value');252 shouldBe('stepUpExplicitBounds(null, null, "foo", "0")', '"1"');253 shouldBe('stepUpExplicitBounds(null, null, "0", "1")', '"2"');254 shouldBe('stepUpExplicitBounds(null, null, "-1", "2")', '"3"');255 shouldBe('stepDownExplicitBounds(null, null, "foo", "1")', '"0"');256 shouldBe('stepDownExplicitBounds(null, null, "0", "2")', '"1"');257 shouldBe('stepDownExplicitBounds(null, null, "-1", "3")', '"2"');258 debug('Step=any');259 shouldBe('stepUpExplicitBounds(null, null, "any", "1")', '"2"');260 shouldBe('stepDownExplicitBounds(null, null, "any", "1")', '"0"');261 debug('Overflow/underflow');262 shouldBe('stepUpExplicitBounds(null, "100", "1", "99")', '"100"');263 shouldBe('stepUpExplicitBounds(null, "100", "1", "100")', '"100"');264 shouldBe('stepUpExplicitBounds(null, "100", "1", "99", 2)', '"100"');265 shouldBe('stepDownExplicitBounds("0", null, "1", "1")', '"0"');266 shouldBe('stepDownExplicitBounds("0", null, "1", "0")', '"0"');267 shouldBe('stepDownExplicitBounds("0", null, "1", "1", 2)', '"0"');268 shouldBe('stepDownExplicitBounds(null, null, "3.40282346e+38", "1", 2)', '"0"');269 shouldBe('stepUpExplicitBounds(-100, 0, 1, -1)', '"0"');270 shouldBe('stepUpExplicitBounds(null, 0, 1, 0)', '"0"');271 shouldBe('stepUpExplicitBounds(-100, 0, 1, -1, 2)', '"0"');272 shouldBe('stepUpExplicitBounds(null, null, "3.40282346e+38", "1", 2)', '"0"');273 debug('stepDown()/stepUp() for stepMismatch values');274 shouldBe('stepUpExplicitBounds(null, null, 2, 1)', '"4"');275 shouldBe('stepUpExplicitBounds(0, null, 10, 9, 9)', '"100"');276 shouldBe('stepDownExplicitBounds(0, null, 10, 19)', '"10"');277 debug('value + step is <= max, but rounded result would be > max.');278 shouldBe('stepUpExplicitBounds(null, 99, 10, 89)', '"90"');279 debug('Huge value and small step');280 shouldBe('stepUpExplicitBounds(0, 1e38, 1, 1e38, 999)', '"1e+38"');281 shouldBe('stepDownExplicitBounds(0, 1e38, 1, 1e38, 999)', '"1e+38"');282 debug('Fractional numbers');283 shouldBe('stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3)', '"1"');284 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1)', '"1.1"');285 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1, 8)', '"1.8"');286 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1, 10)', '"2"');287 shouldBe('stepUpExplicitBounds(0, 1, 0.003921568627450980, 0, 255)', '"1"');288 shouldBe('stepDownExplicitBounds(null, null, 0.1, 1, 8)', '"0.2"');289 shouldBe('stepDownExplicitBounds(null, null, 0.1, 1)', '"0.9"');290 291 debug('');292 debug('Time type');293 57 input.type = 'time'; 294 58 debug('Function arguments are (value, step, {min or max}, [stepCount]).'); … … 316 80 debug(''); 317 81 var successfullyParsed = true; 82 </script> 83 <script src="../../js/resources/js-test-post.js"></script> 84 </body> 85 </html> -
trunk/LayoutTests/fast/forms/time/time-stepup-stepdown.html
r92745 r92746 1 description('Check stepUp() and stepDown() bahevior for type=date, datetime, datetime-local, time.'); 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <link rel="stylesheet" href="../../js/resources/js-test-style.css"> 5 <script src="../../js/resources/js-test-pre.js"></script> 6 </head> 7 <body> 8 <p id="description"></p> 9 <div id="console"></div> 10 <script> 11 description('Check stepUp() and stepDown() bahevior for type=time.'); 2 12 3 13 var input = document.createElement('input'); … … 29 39 } 30 40 31 // Range value gets automatically shifted based on bounds,32 // So always set the min and max first to get expected behavior33 34 function stepUpExplicitBounds(min, max, step, value, stepCount) {35 setInputAttributes(min, max, step, value);36 if (typeof stepCount !== 'undefined')37 input.stepUp(stepCount);38 else39 input.stepUp();40 return input.value;41 }42 43 function stepDownExplicitBounds(min, max, step, value, stepCount) {44 setInputAttributes(min, max, step, value);45 if (typeof stepCount !== 'undefined')46 input.stepDown(stepCount);47 else48 input.stepDown();49 return input.value;50 }51 52 debug('Date type');53 input.type = 'date';54 debug('Invalid value');55 shouldThrow('stepUp("", null, null)', invalidStateErr);56 shouldThrow('stepDown("", null, null)', invalidStateErr);57 debug('Non-number arguments');58 shouldBe('stepUp("2010-02-10", null, null, "0")', '"2010-02-10"');59 shouldBe('stepDown("2010-02-10", null, null, "0")', '"2010-02-10"');60 shouldBe('stepUp("2010-02-10", null, null, "foo")', '"2010-02-10"');61 shouldBe('stepDown("2010-02-10", null, null, "foo")', '"2010-02-10"');62 shouldBe('stepUp("2010-02-10", null, null, null)', '"2010-02-10"');63 shouldBe('stepDown("2010-02-10", null, null, null)', '"2010-02-10"');64 debug('Normal cases');65 shouldBe('stepUp("2010-02-10", null, null)', '"2010-02-11"');66 shouldBe('stepDown("2010-02-10", null, null)', '"2010-02-09"');67 shouldBe('stepUp("2010-02-10", null, null, 10)', '"2010-02-20"');68 shouldBe('stepDown("2010-02-10", null, null, 11)', '"2010-01-30"');69 shouldBe('stepUp("1970-01-01", "4", null, 2)', '"1970-01-09"');70 shouldBe('stepDown("1970-01-01", "4", null, 3)', '"1969-12-20"');71 debug('Step=any');72 shouldThrow('stepUp("2010-02-10", "any", null)', invalidStateErr);73 shouldThrow('stepDown("2010-02-10", "any", null)', invalidStateErr);74 debug('Overflow/underflow');75 shouldThrow('stepUp("2010-02-10", "3.40282346e+38", null)', invalidStateErr);76 shouldThrow('stepDown("2010-02-10", "3.40282346e+38", null)', invalidStateErr);77 shouldThrow('stepUp("2010-02-10", "1", "2010-02-10")', invalidStateErr);78 shouldThrow('stepDown("2010-02-10", "1", "2010-02-10")', invalidStateErr);79 80 debug('');81 debug('Datetime type');82 input.type = 'datetime';83 debug('Invalid value');84 shouldThrow('stepUp("", null, null)', invalidStateErr);85 shouldThrow('stepDown("", null, null)', invalidStateErr);86 debug('Non-number arguments');87 shouldBe('stepUp("2010-02-10T20:13Z", null, null, "0")', '"2010-02-10T20:13Z"');88 shouldBe('stepDown("2010-02-10T20:13Z", null, null, "0")', '"2010-02-10T20:13Z"');89 shouldBe('stepUp("2010-02-10T20:13Z", null, null, "foo")', '"2010-02-10T20:13Z"');90 shouldBe('stepDown("2010-02-10T20:13Z", null, null, "foo")', '"2010-02-10T20:13Z"');91 shouldBe('stepUp("2010-02-10T20:13Z", null, null, null)', '"2010-02-10T20:13Z"');92 shouldBe('stepDown("2010-02-10T20:13Z", null, null, null)', '"2010-02-10T20:13Z"');93 debug('Normal cases');94 shouldBe('stepUp("2010-02-10T20:13Z", null, null)', '"2010-02-10T20:14Z"');95 shouldBe('stepDown("2010-02-10T20:13Z", null, null)', '"2010-02-10T20:12Z"');96 shouldBe('stepUp("2010-02-10T20:13Z", null, null, 10)', '"2010-02-10T20:23Z"');97 shouldBe('stepDown("2010-02-10T20:13Z", null, null, 11)', '"2010-02-10T20:02Z"');98 shouldBe('stepUp("1970-01-01T20:13Z", "4", null, 2)', '"1970-01-01T20:13:08Z"');99 shouldBe('stepDown("1970-01-01T20:13Z", "4", null, 3)', '"1970-01-01T20:12:48Z"');100 debug('Step=any');101 shouldThrow('stepUp("2010-02-10T20:13Z", "any", null)', invalidStateErr);102 shouldThrow('stepDown("2010-02-10T20:13Z", "any", null)', invalidStateErr);103 debug('Overflow/underflow');104 shouldThrow('stepUp("2010-02-10T20:13Z", "3.40282346e+38", null)', invalidStateErr);105 shouldThrow('stepDown("2010-02-10T20:13Z", "3.40282346e+38", null)', invalidStateErr);106 shouldThrow('stepUp("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z")', invalidStateErr);107 shouldThrow('stepDown("2010-02-10T20:13Z", "1", "2010-02-10T20:13Z")', invalidStateErr);108 109 debug('');110 debug('Datetime-local type');111 input.type = 'datetime-local';112 debug('Invalid value');113 shouldThrow('stepUp("", null, null)', invalidStateErr);114 shouldThrow('stepDown("", null, null)', invalidStateErr);115 debug('Non-number arguments');116 shouldBe('stepUp("2010-02-10T20:13", null, null, "0")', '"2010-02-10T20:13"');117 shouldBe('stepDown("2010-02-10T20:13", null, null, "0")', '"2010-02-10T20:13"');118 shouldBe('stepUp("2010-02-10T20:13", null, null, "foo")', '"2010-02-10T20:13"');119 shouldBe('stepDown("2010-02-10T20:13", null, null, "foo")', '"2010-02-10T20:13"');120 shouldBe('stepUp("2010-02-10T20:13", null, null, null)', '"2010-02-10T20:13"');121 shouldBe('stepDown("2010-02-10T20:13", null, null, null)', '"2010-02-10T20:13"');122 debug('Normal cases');123 shouldBe('stepUp("2010-02-10T20:13", null, null)', '"2010-02-10T20:14"');124 shouldBe('stepDown("2010-02-10T20:13", null, null)', '"2010-02-10T20:12"');125 shouldBe('stepUp("2010-02-10T20:13", null, null, 10)', '"2010-02-10T20:23"');126 shouldBe('stepDown("2010-02-10T20:13", null, null, 11)', '"2010-02-10T20:02"');127 shouldBe('stepUp("1970-01-01T20:13", "4", null, 2)', '"1970-01-01T20:13:08"');128 shouldBe('stepDown("1970-01-01T20:13", "4", null, 3)', '"1970-01-01T20:12:48"');129 debug('Step=any');130 shouldThrow('stepUp("2010-02-10T20:13", "any", null)', invalidStateErr);131 shouldThrow('stepDown("2010-02-10T20:13", "any", null)', invalidStateErr);132 debug('Overflow/underflow');133 shouldThrow('stepUp("2010-02-10T20:13", "3.40282346e+38", null)', invalidStateErr);134 shouldThrow('stepDown("2010-02-10T20:13", "3.40282346e+38", null)', invalidStateErr);135 shouldThrow('stepUp("2010-02-10T20:13", "1", "2010-02-10T20:13")', invalidStateErr);136 shouldThrow('stepDown("2010-02-10T20:13", "1", "2010-02-10T20:13")', invalidStateErr);137 138 debug('');139 debug('Number type');140 input.type = 'number';141 debug('Invalid value');142 shouldThrow('stepUp("", null, null)', invalidStateErr);143 shouldThrow('stepDown("", null, null)', invalidStateErr);144 debug('Non-number arguments');145 shouldBe('stepUp("0", null, null, "0")', '"0"');146 shouldBe('stepDown("0", null, null, "0")', '"0"');147 shouldBe('stepUp("0", null, null, "foo")', '"0"');148 shouldBe('stepDown("0", null, null, "foo")', '"0"');149 shouldBe('stepUp("0", null, null, null)', '"0"');150 shouldBe('stepDown("0", null, null, null)', '"0"');151 debug('Normal cases');152 shouldBe('stepUp("0", null, null)', '"1"');153 shouldBe('stepUp("1", null, null, 2)', '"3"');154 shouldBe('stepUp("3", null, null, -1)', '"2"');155 shouldBe('stepDown("2", null, null)', '"1"');156 shouldBe('stepDown("1", null, null, 2)', '"-1"');157 shouldBe('stepDown("-1", null, null, -1)', '"0"');158 debug('Extra arguments');159 shouldBe('input.value = "0"; input.min = null; input.step = null; input.stepUp(1, 2); input.value', '"1"');160 shouldBe('input.value = "1"; input.stepDown(1, 3); input.value', '"0"');161 debug('Invalid step value');162 shouldBe('stepUp("0", "foo", null)', '"1"');163 shouldBe('stepUp("1", "0", null)', '"2"');164 shouldBe('stepUp("2", "-1", null)', '"3"');165 debug('Step=any');166 shouldThrow('stepUp("0", "any", null)', invalidStateErr);167 shouldThrow('stepDown("0", "any", null)', invalidStateErr);168 debug('Step=any corner case');169 shouldThrow('stepUpExplicitBounds("0", "100", "any", "1.5", "1")', invalidStateErr);170 shouldThrow('stepDownExplicitBounds("0", "100", "any", "1.5", "1")', invalidStateErr);171 debug('Overflow/underflow');172 shouldBe('stepDown("1", "1", "0")', '"0"');173 shouldThrow('stepDown("0", "1", "0")', invalidStateErr);174 shouldThrow('stepDown("1", "1", "0", 2)', invalidStateErr);175 shouldBe('input.value', '"1"');176 shouldThrow('stepDown("1", "3.40282346e+38", "", 2)', invalidStateErr);177 shouldBe('stepUp("-1", "1", "0")', '"0"');178 shouldThrow('stepUp("0", "1", "0")', invalidStateErr);179 shouldThrow('stepUp("-1", "1", "0", 2)', invalidStateErr);180 shouldBe('input.value', '"-1"');181 shouldThrow('stepUp("1", "3.40282346e+38", "", 2)', invalidStateErr);182 debug('stepDown()/stepUp() for stepMismatch values');183 shouldBe('stepUp("1", "2", "")', '"3"');184 shouldBe('input.stepDown(); input.value', '"1"');185 shouldBe('input.min = "0"; stepUp("9", "10", "", 9)', '"99"');186 shouldBe('stepDown("19", "10", "0")', '"9"');187 shouldBe('stepUp("89", "10", "99")', '"99"');188 debug('Huge value and small step');189 shouldBe('input.min = ""; stepUp("1e+38", "1", "", 999999)', '"1e+38"');190 shouldBe('input.max = ""; stepDown("1e+38", "1", "", 999999)', '"1e+38"');191 debug('Fractional numbers');192 shouldBe('input.min = ""; stepUp("0", "0.33333333333333333", "", 3)', '"1"');193 shouldBe('stepUp("1", "0.1", "", 10)', '"2"');194 shouldBe('input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.value', '"3"');195 shouldBe('input.min = "0"; stepUp("0", "0.003921568627450980", "1", 255)', '"1"');196 shouldBe('for (var i = 0; i < 255; i++) { input.stepDown(); }; input.value', '"0"');197 debug('Rounding');198 shouldBe('stepUp("5.005", "0.005", "", 2)', '"5.015"');199 shouldBe('stepUp("5.005", "0.005", "", 11)', '"5.06"');200 shouldBe('stepUp("5.005", "0.005", "", 12)', '"5.065"');201 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 2)', '"5.015"');202 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 11)', '"5.06"');203 shouldBe('stepUpExplicitBounds("4", "9", "0.005", "5.005", 12)', '"5.065"');204 205 debug('');206 debug('Range type');207 input.type = 'range';208 debug('function arguments are (min, max, step, value, [stepCount])');209 debug('Using the default values');210 shouldBe('stepUpExplicitBounds(null, null, null, "")', '"51"');211 shouldBe('stepDownExplicitBounds(null, null, null, "")', '"49"');212 debug('Non-number arguments (stepCount)');213 shouldBe('stepUpExplicitBounds(null, null, null, "0", "0")', '"0"');214 shouldBe('stepDownExplicitBounds(null, null, null, "0", "0")', '"0"');215 shouldBe('stepUpExplicitBounds(null, null, null, "0", "foo")', '"0"');216 shouldBe('stepDownExplicitBounds(null, null, null, "0", "foo")', '"0"');217 shouldBe('stepUpExplicitBounds(null, null, null, "0", null)', '"0"');218 shouldBe('stepDownExplicitBounds(null, null, null, "0", null)', '"0"');219 debug('Normal cases');220 shouldBe('stepUpExplicitBounds(null, null, null, "0")', '"1"');221 shouldBe('stepUpExplicitBounds(null, null, null, "1", 2)', '"3"');222 shouldBe('stepUpExplicitBounds(null, null, null, "3", -1)', '"2"');223 shouldBe('stepDownExplicitBounds("-100", null, null, "2")', '"1"');224 shouldBe('stepDownExplicitBounds("-100", null, null, "1", 2)', '"-1"');225 shouldBe('stepDownExplicitBounds("-100", null, null, "-1", -1)', '"0"');226 debug('Extra arguments');227 shouldBe('setInputAttributes(null, null, null, "0"); input.stepUp(1,2); input.value', '"1"');228 shouldBe('setInputAttributes(null, null, null, "1"); input.stepDown(1,3); input.value', '"0"');229 debug('Invalid step value');230 shouldBe('stepUpExplicitBounds(null, null, "foo", "0")', '"1"');231 shouldBe('stepUpExplicitBounds(null, null, "0", "1")', '"2"');232 shouldBe('stepUpExplicitBounds(null, null, "-1", "2")', '"3"');233 shouldBe('stepDownExplicitBounds(null, null, "foo", "1")', '"0"');234 shouldBe('stepDownExplicitBounds(null, null, "0", "2")', '"1"');235 shouldBe('stepDownExplicitBounds(null, null, "-1", "3")', '"2"');236 debug('Step=any');237 shouldThrow('stepUpExplicitBounds(null, null, "any", "1")', invalidStateErr);238 shouldThrow('stepDownExplicitBounds(null, null, "any", "1")', invalidStateErr);239 debug('Overflow/underflow');240 shouldBe('stepUpExplicitBounds(null, "100", "1", "99")', '"100"');241 shouldThrow('stepUpExplicitBounds(null, "100", "1", "100")', invalidStateErr);242 shouldBe('input.value', '"100"');243 shouldThrow('stepUpExplicitBounds(null, "100", "1", "99", "2")', invalidStateErr);244 shouldBe('input.value', '"99"');245 shouldBe('stepDownExplicitBounds("0", null, "1", "1")', '"0"');246 shouldThrow('stepDownExplicitBounds("0", null, "1", "0")', invalidStateErr);247 shouldBe('input.value', '"0"');248 shouldThrow('stepDownExplicitBounds("0", null, "1", "1", "2")', invalidStateErr);249 shouldBe('input.value', '"1"');250 shouldThrow('stepDownExplicitBounds(null, null, "3.40282346e+38", "1", "2")', invalidStateErr);251 shouldBe('stepUpExplicitBounds(-100, 0, 1, -1)', '"0"');252 shouldThrow('stepUpExplicitBounds(null, 0, 1, 0)', invalidStateErr);253 shouldThrow('stepUpExplicitBounds(-100, 0, 1, -1, 2)', invalidStateErr);254 shouldBe('input.value', '"-1"');255 shouldThrow('stepUpExplicitBounds(null, null, "3.40282346e+38", "1", "2")', invalidStateErr);256 debug('stepDown()/stepUp() for stepMismatch values');257 shouldBe('stepUpExplicitBounds(null, null, 2, 1)', '"4"');258 shouldBe('input.stepDown(); input.value', '"2"');259 shouldBe('stepUpExplicitBounds(0, null, 10, 9, 9)', '"100"');260 shouldBe('stepDownExplicitBounds(0, null, 10, 19)', '"10"');261 debug('value + step is <= max, but rounded result would be > max.');262 shouldThrow('stepUpExplicitBounds(null, 99, 10, 89)', invalidStateErr);263 debug('Huge value and small step');264 shouldBe('stepUpExplicitBounds(0, 1e38, 1, 1e38, 999999)', '"1e+38"');265 shouldBe('stepDownExplicitBounds(0, 1e38, 1, 1e38, 999999)', '"1e+38"');266 debug('Fractional numbers');267 shouldBe('stepUpExplicitBounds(null, null, 0.33333333333333333, 0, 3)', '"1"');268 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1)', '"1.1"');269 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1, 8)', '"1.8"');270 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1, 10)', '"2"');271 shouldBe('input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.value', '"3"');272 shouldBe('stepUpExplicitBounds(0, 1, 0.003921568627450980, 0, 255)', '"1"');273 shouldBe('for (var i = 0; i < 255; i++) { input.stepDown(); }; input.value', '"0"');274 shouldBe('stepDownExplicitBounds(null, null, 0.1, 1, 8)', '"0.2"');275 shouldBe('stepDownExplicitBounds(null, null, 0.1, 1)', '"0.9"');276 277 debug('');278 debug('Time type');279 41 input.type = 'time'; 280 42 debug('Invalid value'); … … 307 69 308 70 debug(''); 309 debug('Unsupported type');310 shouldThrow('input.step = "3"; input.min = ""; input.max = ""; input.value = "2"; input.stepDown()', '"Error: INVALID_STATE_ERR: DOM Exception 11"');311 shouldThrow('input.stepDown(0)', '"Error: INVALID_STATE_ERR: DOM Exception 11"');312 shouldThrow('input.stepUp()', '"Error: INVALID_STATE_ERR: DOM Exception 11"');313 shouldThrow('input.stepUp(0)', '"Error: INVALID_STATE_ERR: DOM Exception 11"');314 315 71 var successfullyParsed = true; 72 </script> 73 <script src="../../js/resources/js-test-post.js"></script> 74 </body> 75 </html>
Note: See TracChangeset
for help on using the changeset viewer.