Changeset 66355 in webkit
- Timestamp:
- Aug 29, 2010 9:47:24 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 36 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r66354 r66355 1 2010-08-29 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Change lower and higher limits of date/datetime/datetime-local/month/week types 6 https://bugs.webkit.org/show_bug.cgi?id=39737 7 8 Update tests and test results for the new DateComponents behavior. 9 10 * fast/forms/ValidityState-rangeOverflow-expected.txt: 11 * fast/forms/ValidityState-stepMismatch-expected.txt: 12 * fast/forms/ValidityState-typeMismatch-date-expected.txt: 13 * fast/forms/ValidityState-typeMismatch-datetime-expected.txt: 14 * fast/forms/ValidityState-typeMismatch-datetimelocal-expected.txt: 15 * fast/forms/ValidityState-typeMismatch-month-expected.txt: 16 * fast/forms/ValidityState-typeMismatch-week-expected.txt: 17 * fast/forms/input-valueasdate-date-expected.txt: 18 * fast/forms/input-valueasdate-datetime-expected.txt: 19 * fast/forms/input-valueasdate-month-expected.txt: 20 * fast/forms/input-valueasdate-week-expected.txt: 21 * fast/forms/input-valueasnumber-date-expected.txt: 22 * fast/forms/input-valueasnumber-datetime-expected.txt: 23 * fast/forms/input-valueasnumber-datetimelocal-expected.txt: 24 * fast/forms/input-valueasnumber-month-expected.txt: 25 * fast/forms/input-valueasnumber-week-expected.txt: 26 * fast/forms/script-tests/ValidityState-rangeOverflow.js: 27 * fast/forms/script-tests/ValidityState-stepMismatch.js: 28 * fast/forms/script-tests/ValidityState-typeMismatch-date.js: 29 * fast/forms/script-tests/ValidityState-typeMismatch-datetime.js: 30 * fast/forms/script-tests/ValidityState-typeMismatch-datetimelocal.js: 31 * fast/forms/script-tests/ValidityState-typeMismatch-month.js: 32 * fast/forms/script-tests/ValidityState-typeMismatch-week.js: 33 * fast/forms/script-tests/input-valueasdate-date.js: 34 * fast/forms/script-tests/input-valueasdate-datetime.js: 35 * fast/forms/script-tests/input-valueasdate-month.js: 36 * fast/forms/script-tests/input-valueasdate-week.js: 37 * fast/forms/script-tests/input-valueasnumber-date.js: 38 * fast/forms/script-tests/input-valueasnumber-datetime.js: 39 * fast/forms/script-tests/input-valueasnumber-datetimelocal.js: 40 * fast/forms/script-tests/input-valueasnumber-month.js: 41 * fast/forms/script-tests/input-valueasnumber-week.js: 42 1 43 2010-08-29 Yuzo Fujishima <yuzo@google.com> 2 44 -
trunk/LayoutTests/fast/forms/ValidityState-rangeOverflow-expected.txt
r56242 r66355 15 15 PASS The value "2010-01-27" doesn't overflow the maximum value "2011-01-26". 16 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 " 1000-01-01".17 PASS The value "2010-01-27" doesn't overflow the maximum value "0000-01-01". 18 18 PASS The value "2010-01-27" overflows the maximum value "2010-01-26". 19 19 PASS The value "9999-01-01" overflows the maximum value "2010-12-31". … … 28 28 PASS The value "2010-01-27T12:34Z" doesn't overflow the maximum value "2011-01-26T12:34Z". 29 29 PASS The value "foo" doesn't overflow the maximum value "2011-01-26T12:34Z". 30 PASS The value "2010-01-27T12:34Z" doesn't overflow the maximum value " 1000-01-01T00:00Z".30 PASS The value "2010-01-27T12:34Z" doesn't overflow the maximum value "0000-01-01T00:00Z". 31 31 PASS The value "2010-01-27T12:34Z" overflows the maximum value "2010-01-26T12:33:59.999Z". 32 32 PASS The value "9999-01-01T23:59Z" overflows the maximum value "2010-12-31T00:00Z". … … 41 41 PASS The value "2010-01-27T12:34" doesn't overflow the maximum value "2011-01-26T12:34". 42 42 PASS The value "foo" doesn't overflow the maximum value "2011-01-26T12:34". 43 PASS The value "2010-01-27T12:34" doesn't overflow the maximum value " 1000-01-01T00:00".43 PASS The value "2010-01-27T12:34" doesn't overflow the maximum value "0000-01-01T00:00". 44 44 PASS The value "2010-01-27T12:34" overflows the maximum value "2010-01-26T12:33:59.999". 45 45 PASS The value "9999-01-01T23:59" overflows the maximum value "2010-12-31T00:00". … … 54 54 PASS The value "2010-01" doesn't overflow the maximum value "2011-01". 55 55 PASS The value "foo" doesn't overflow the maximum value "2011-01". 56 PASS The value "2010-01" doesn't overflow the maximum value " 1000-01".56 PASS The value "2010-01" doesn't overflow the maximum value "0000-01". 57 57 PASS The value "2010-01" overflows the maximum value "2009-12". 58 58 PASS The value "9999-01" overflows the maximum value "2010-12". … … 94 94 PASS The value "2010-W01" doesn't overflow the maximum value "2011-W01". 95 95 PASS The value "foo" doesn't overflow the maximum value "2011-W01". 96 PASS The value "2010-W01" doesn't overflow the maximum value "1582-W01". 96 PASS The value "2010-W01" doesn't overflow the maximum value "0000-W01". 97 PASS The value "2010-W01" overflows the maximum value "1582-W01". 97 98 PASS The value "2010-W01" overflows the maximum value "2009-W12". 98 99 PASS The value "9999-W01" overflows the maximum value "2010-W12". -
trunk/LayoutTests/fast/forms/ValidityState-stepMismatch-expected.txt
r55423 r66355 43 43 PASS stepMismatchFor("2010-02-09T12:34Z", "86400", "2010-02-08T12:34Z") is false 44 44 PASS stepMismatchFor("2010-02-09T12:34:56Z", "86400", "2010-02-08T12:34Z") is true 45 PASS stepMismatchFor("275760-09-13T00:00Z", "3", "275760-09-13T23:50:50Z") is true 46 PASS stepMismatchFor("275760-09-13T00:00Z", "2", "275760-09-13T23:50:50Z") is false 45 PASS stepMismatchFor("275760-09-13T00:00Z", "3", "275760-09-12T23:59:50Z") is true 46 PASS stepMismatchFor("275760-09-13T00:00Z", "2", "275760-09-12T23:59:50Z") is false 47 PASS stepMismatchFor("0001-01-01T00:00Z", "3", "0001-01-11T00:00:02Z") is true 48 PASS stepMismatchFor("0001-01-01T00:00Z", "2", "0001-01-11T00:00:02Z") is false 47 49 Implicit step base 48 50 PASS stepMismatchFor("1970-01-01T12:34Z", "120", null) is false … … 71 73 PASS stepMismatchFor("2010-02-09T12:34", "86400", "2010-02-08T12:34") is false 72 74 PASS stepMismatchFor("2010-02-09T12:34:56", "86400", "2010-02-08T12:34") is true 73 PASS stepMismatchFor("275760-09-13T00:00", "3", "275760-09-13T23:50:50") is true 74 PASS stepMismatchFor("275760-09-13T00:00", "2", "275760-09-13T23:50:50") is false 75 PASS stepMismatchFor("275760-09-13T00:00", "3", "275760-09-12T23:59:50") is true 76 PASS stepMismatchFor("275760-09-13T00:00", "2", "275760-09-12T23:59:50") is false 77 PASS stepMismatchFor("0001-01-01T00:00", "3", "0001-01-11T00:00:02") is true 78 PASS stepMismatchFor("0001-01-01T00:00", "2", "0001-01-11T00:00:02") is false 75 79 Implicit step base 76 80 PASS stepMismatchFor("1970-01-01T12:34", "120", null) is false -
trunk/LayoutTests/fast/forms/ValidityState-typeMismatch-date-expected.txt
r51163 r66355 7 7 PASS "2009-09-07" is a correct valid date string. 8 8 PASS "9999-12-31" is a correct valid date string. 9 PASS "2 147483647-12-31" is a correct valid date string.9 PASS "275760-09-13" is a correct valid date string. 10 10 PASS "1582-10-15" is a correct valid date string. 11 PASS "0001-01-01" is a correct valid date string. 11 12 PASS "2009-01-31" is a correct valid date string. 12 13 PASS "2009-02-28" is a correct valid date string. … … 26 27 PASS "a" is a correct invalid date string. 27 28 PASS "-1-09-07" is a correct invalid date string. 28 PASS "1581-09-07" is a correct invalid date string. 29 PASS "1582-10-14" is a correct invalid date string. 29 PASS "0000-12-31" is a correct invalid date string. 30 PASS "0000-01-01" is a correct invalid date string. 31 PASS "275760-09-14" is a correct invalid date string. 30 32 PASS "2147483648-12-31" is a correct invalid date string. 31 33 PASS "2009/09/07" is a correct invalid date string. … … 34 36 PASS "2009-00-07" is a correct invalid date string. 35 37 PASS "2009-13-07" is a correct invalid date string. 36 PASS "1582-09-30" is a correct invalid date string.37 38 PASS "2009-xx-30" is a correct invalid date string. 38 39 PASS "2009-01-32" is a correct invalid date string. -
trunk/LayoutTests/fast/forms/ValidityState-typeMismatch-datetime-expected.txt
r51163 r66355 11 11 PASS "2009-09-07T16:49:31.123Z" is a correct valid datetime string. 12 12 PASS "2009-09-07T16:49:31.1234567890Z" is a correct valid datetime string. 13 PASS "2147483647-12-31T23:59:59.999Z" is a correct valid datetime string. 14 PASS "1582-10-15T00:00:00.000Z" is a correct valid datetime string. 15 PASS "1582-10-15T00:00:00.000+00:00" is a correct valid datetime string. 16 PASS "1582-10-15T01:30+01:30" is a correct valid datetime string. 17 PASS "1582-10-15T00:00+01:00" is a correct valid datetime string. 13 PASS "275760-09-12T23:59:59.999Z" is a correct valid datetime string. 14 PASS "275760-09-13T00:00:00.000Z" is a correct valid datetime string. 15 PASS "0001-01-01T00:00:00.000Z" is a correct valid datetime string. 16 PASS "0001-01-01T00:00:00.000+00:00" is a correct valid datetime string. 17 PASS "0001-01-01T01:30+01:30" is a correct valid datetime string. 18 PASS "0001-01-01T00:00+01:00" is a correct valid datetime string. 18 19 PASS " 2009-09-07T16:49Z " is a correct invalid datetime string. 19 20 PASS "2009-09-07T16:49z" is a correct invalid datetime string. … … 31 32 PASS "2009-09-07T16:49-24:00" is a correct invalid datetime string. 32 33 PASS "2009-09-07T16:49-23:60" is a correct invalid datetime string. 33 PASS " 1582-10-14T23:59:59Z" is a correct invalid datetime string.34 PASS "0000-12-31T23:59:59Z" is a correct invalid datetime string. 34 35 PASS "2147483647-12-31T23:59-00:01" is a correct invalid datetime string. 35 36 PASS "2147483648-01-01T00:00:00Z" is a correct invalid datetime string. -
trunk/LayoutTests/fast/forms/ValidityState-typeMismatch-datetimelocal-expected.txt
r51163 r66355 11 11 PASS "2009-09-07T16:49:31.123" is a correct valid datetime-local string. 12 12 PASS "2009-09-07T16:49:31.1234567890" is a correct valid datetime-local string. 13 PASS "2 147483647-12-31T23:59:59.999" is a correct valid datetime-local string.14 PASS " 1582-10-15T00:00:00.000" is a correct valid datetime-local string.13 PASS "275760-09-13T00:00:00.000" is a correct valid datetime-local string. 14 PASS "0001-01-01T00:00:00.000" is a correct valid datetime-local string. 15 15 PASS " 2009-09-07T16:49 " is a correct invalid datetime-local string. 16 16 PASS "2009-09-07t16:49" is a correct invalid datetime-local string. … … 19 19 PASS "a" is a correct invalid datetime-local string. 20 20 PASS "-1-09-07T16:49" is a correct invalid datetime-local string. 21 PASS " 1582-10-14T23:59:59" is a correct invalid datetime-local string.22 PASS "2 147483648-01-01T00:00:00" is a correct invalid datetime-local string.21 PASS "0000-12-31T23:59:59.999" is a correct invalid datetime-local string. 22 PASS "275760-09-13T00:00:00.001" is a correct invalid datetime-local string. 23 23 PASS successfullyParsed is true 24 24 -
trunk/LayoutTests/fast/forms/ValidityState-typeMismatch-month-expected.txt
r51163 r66355 5 5 6 6 PASS "" is a correct valid month string. 7 PASS " 1582-10" is a correct valid month string.7 PASS "0001-01" is a correct valid month string. 8 8 PASS "9999-12" is a correct valid month string. 9 PASS "2 147483647-12" is a correct valid month string.9 PASS "275760-09" is a correct valid month string. 10 10 PASS "2009-01" is a correct valid month string. 11 11 PASS "2009-02" is a correct valid month string. … … 23 23 PASS "a" is a correct invalid month string. 24 24 PASS "-1-09" is a correct invalid month string. 25 PASS "1581-10" is a correct invalid month string. 26 PASS "1582-09" is a correct invalid month string. 25 PASS "0000-12" is a correct invalid month string. 27 26 PASS "2147483648-12" is a correct invalid month string. 27 PASS "275760-10" is a correct invalid month string. 28 28 PASS "2009/09" is a correct invalid month string. 29 29 PASS "200909" is a correct invalid month string. -
trunk/LayoutTests/fast/forms/ValidityState-typeMismatch-week-expected.txt
r51163 r66355 5 5 6 6 PASS "" is a correct valid week string. 7 PASS "0001-W01" is a correct valid week string. 7 8 PASS "1583-W01" is a correct valid week string. 8 9 PASS "9999-W52" is a correct valid week string. 9 PASS "2 147483647-W52" is a correct valid week string.10 PASS "275760-W37" is a correct valid week string. 10 11 PASS "2009-W01" is a correct valid week string. 11 12 PASS "2004-W53" is a correct valid week string. … … 19 20 PASS "a" is a correct invalid week string. 20 21 PASS "-1-W09" is a correct invalid week string. 21 PASS " 1582-W52" is a correct invalid week string.22 PASS "0000-W52" is a correct invalid week string. 22 23 PASS "2147483648-W01" is a correct invalid week string. 24 PASS "275760-W38" is a correct invalid week string. 23 25 PASS "2009-W00" is a correct invalid week string. 24 26 PASS "2009-W-1" is a correct invalid week string. -
trunk/LayoutTests/fast/forms/input-valueasdate-date-expected.txt
r53606 r66355 12 12 PASS setValueAsDateAndGetValue(2009, 11, 31) is "2009-12-31" 13 13 PASS setValueAsDateAndGetValue(10000, 0, 1) is "10000-01-01" 14 PASS setValueAsDateAndGetValue(794, 9, 22) is "" 15 PASS setValueAsDateAndGetValue(1582, 8, 30) is "" 14 PASS setValueAsDateAndGetValue(-1, 0, 1) is "" 15 PASS setValueAsDateAndGetValue(0, 11, 31) is "" 16 PASS setValueAsDateAndGetValue(1, 0, 1) is "0001-01-01" 16 17 PASS setValueAsDateAndGetValue(1582, 9, 15) is "1582-10-15" 17 18 PASS setValueAsDateAndGetValue(1582, 9, 31) is "1582-10-31" -
trunk/LayoutTests/fast/forms/input-valueasdate-datetime-expected.txt
r54647 r66355 12 12 PASS setValueAsDateAndGetValue(2009, 11, 31, 23, 59, 59, 999) is "2009-12-31T23:59:59.999Z" 13 13 PASS setValueAsDateAndGetValue(10000, 0, 1, 12, 0, 1, 0) is "10000-01-01T12:00:01Z" 14 PASS setValueAsDateAndGetValue( 794, 9, 22, 0, 0, 0, 0) is ""15 PASS setValueAsDateAndGetValue( 1582, 9, 14, 23, 59, 59, 999) is ""16 PASS setValueAsDateAndGetValue(1 582, 9, 15, 0, 0, 0, 0) is "1582-10-15T00:00Z"14 PASS setValueAsDateAndGetValue(-1, 9, 22, 0, 0, 0, 0) is "" 15 PASS setValueAsDateAndGetValue(0, 11, 31, 23, 59, 59, 999) is "" 16 PASS setValueAsDateAndGetValue(1, 0, 1, 0, 0, 0, 0) is "0001-01-01T00:00Z" 17 17 PASS setValueAsDateAndGetValue(275760, 8, 13, 0, 0, 0, 0) is "275760-09-13T00:00Z" 18 18 PASS setValueAsDateAndGetValue(275760, 8, 13, 0, 0, 0, 1) is "" -
trunk/LayoutTests/fast/forms/input-valueasdate-month-expected.txt
r53445 r66355 12 12 PASS setValueAsDateAndGetValue(2009, 11, 31) is "2009-12" 13 13 PASS setValueAsDateAndGetValue(10000, 0, 1) is "10000-01" 14 PASS setValueAsDateAndGetValue( 794, 9, 22) is ""15 PASS setValueAsDateAndGetValue( 1582, 8, 30) is ""16 PASS setValueAsDateAndGetValue( 1582, 9, 1) is "1582-10"17 PASS setValueAsDateAndGetValue( 1582, 9, 31) is "1582-10"14 PASS setValueAsDateAndGetValue(-1, 9, 22) is "" 15 PASS setValueAsDateAndGetValue(0, 11, 30) is "" 16 PASS setValueAsDateAndGetValue(0001, 0, 1) is "0001-01" 17 PASS setValueAsDateAndGetValue(0001, 0, 31) is "0001-01" 18 18 PASS setValueAsDateAndGetValue(275760, 8, 13) is "275760-09" 19 19 PASS setValueAsDateAndGetValue(275760, 8, 14) is "" -
trunk/LayoutTests/fast/forms/input-valueasdate-week-expected.txt
r53787 r66355 13 13 PASS valueAsDateFor("2006-W01").getTime() is Date.UTC(2006, 0, 2) 14 14 Various January 1st: 15 PASS setValueAsDateAndGetValue(1, 0, 1) is "0001-W01" 15 16 PASS setValueAsDateAndGetValue(2007, 0, 1) is "2007-W01" 16 17 PASS setValueAsDateAndGetValue(2008, 0, 1) is "2008-W01" … … 27 28 PASS setValueAsDateAndGetValue(2010, 0, 17) is "2010-W02" 28 29 PASS setValueAsDateAndGetValue(2010, 11, 31) is "2010-W52" 29 Around Gregorian calendar starting year: 30 PASS setValueAsDateAndGetValue(1582, 9, 14) is "" 31 PASS setValueAsDateAndGetValue(1582, 9, 15) is "" 32 PASS setValueAsDateAndGetValue(1582, 11, 31) is "" 33 PASS setValueAsDateAndGetValue(1583, 0, 1) is "" 34 PASS setValueAsDateAndGetValue(1583, 0, 2) is "" 35 PASS setValueAsDateAndGetValue(1583, 0, 3) is "1583-W01" 30 Around the minimum value: 31 PASS setValueAsDateAndGetValue(0, 11, 31) is "" 32 PASS setValueAsDateAndGetValue(0, 0, 1) is "" 36 33 PASS successfullyParsed is true 37 34 -
trunk/LayoutTests/fast/forms/input-valueasnumber-date-expected.txt
r53991 r66355 12 12 PASS setValueAsNumberAndGetValue(2009, 11, 31) is "2009-12-31" 13 13 PASS setValueAsNumberAndGetValue(10000, 0, 1) is "10000-01-01" 14 PASS setValueAsNumberAndGetValue(794, 9, 22) is "" 15 PASS setValueAsNumberAndGetValue(1582, 8, 30) is "" 16 PASS setValueAsNumberAndGetValue(1582, 9, 15) is "1582-10-15" 17 PASS setValueAsNumberAndGetValue(1582, 9, 31) is "1582-10-31" 14 PASS setValueAsNumberAndGetValue(-1, 0, 1) is "" 15 PASS setValueAsNumberAndGetValue(0, 11, 31) is "" 16 PASS setValueAsNumberAndGetValue(1, 0, 1) is "0001-01-01" 18 17 PASS setValueAsNumberAndGetValue(275760, 8, 13) is "275760-09-13" 19 18 Tests to set invalid values to valueAsNumber: … … 25 24 PASS input.valueAsNumber = Number.POSITIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 26 25 PASS input.valueAsNumber = Number.NEGATIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 26 PASS input.valueAsNumber = Date.UTC(275760, 8, 14) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 27 27 PASS successfullyParsed is true 28 28 -
trunk/LayoutTests/fast/forms/input-valueasnumber-datetime-expected.txt
r54647 r66355 12 12 PASS setValueAsNumberAndGetValue(2009, 11, 31, 23, 59, 59, 999) is "2009-12-31T23:59:59.999Z" 13 13 PASS setValueAsNumberAndGetValue(10000, 0, 1, 12, 0, 1, 0) is "10000-01-01T12:00:01Z" 14 PASS setValueAsNumberAndGetValue( 794, 9, 22, 0, 0, 0, 0) is ""15 PASS setValueAsNumberAndGetValue( 1582, 9, 14, 23, 59, 59, 999) is ""16 PASS setValueAsNumberAndGetValue(1 582, 9, 15, 0, 0, 0, 0) is "1582-10-15T00:00Z"14 PASS setValueAsNumberAndGetValue(-1, 0, 1, 0, 0, 0, 0) is "" 15 PASS setValueAsNumberAndGetValue(0, 11, 31, 23, 59, 59, 999) is "" 16 PASS setValueAsNumberAndGetValue(1, 0, 1, 0, 0, 0, 0) is "0001-01-01T00:00Z" 17 17 PASS setValueAsNumberAndGetValue(275760, 8, 12, 0, 0, 0, 1) is "275760-09-12T00:00:00.001Z" 18 18 PASS setValueAsNumberAndGetValue(275760, 8, 13, 0, 0, 0, 0) is "275760-09-13T00:00Z" … … 25 25 PASS input.valueAsNumber = Number.POSITIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 26 26 PASS input.valueAsNumber = Number.NEGATIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 27 PASS input.valueAsNumber = Date.UTC(275760, 8, 13, 0, 0, 0, 1) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 27 28 Step attribute value and string representation: 28 29 PASS input.step = "1"; setValueAsNumberAndGetValue(2010, 0, 21, 0, 0, 0, 0) is "2010-01-21T00:00:00Z" -
trunk/LayoutTests/fast/forms/input-valueasnumber-datetimelocal-expected.txt
r54647 r66355 12 12 PASS setValueAsNumberAndGetValue(2009, 11, 31, 23, 59, 59, 999) is "2009-12-31T23:59:59.999" 13 13 PASS setValueAsNumberAndGetValue(10000, 0, 1, 12, 0, 1, 0) is "10000-01-01T12:00:01" 14 PASS setValueAsNumberAndGetValue(794, 9, 22, 0, 0, 0, 0) is "" 15 PASS setValueAsNumberAndGetValue(1582, 9, 14, 23, 59, 59, 999) is "" 16 PASS setValueAsNumberAndGetValue(1582, 9, 15, 0, 0, 0, 0) is "1582-10-15T00:00" 14 PASS setValueAsNumberAndGetValue(-1, 0, 1, 0, 0, 0, 0) is "" 15 PASS setValueAsNumberAndGetValue(0, 11, 31, 23, 59, 59, 999) is "" 16 PASS setValueAsNumberAndGetValue(1, 0, 1, 0, 0, 0, 0) is "0001-01-01T00:00" 17 PASS setValueAsNumberAndGetValue(275760, 8, 12, 0, 0, 0, 1) is "275760-09-12T00:00:00.001" 17 18 PASS setValueAsNumberAndGetValue(275760, 8, 13, 0, 0, 0, 0) is "275760-09-13T00:00" 18 19 Tests to set invalid values to valueAsNumber: … … 24 25 PASS input.valueAsNumber = Number.POSITIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 25 26 PASS input.valueAsNumber = Number.NEGATIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 27 PASS input.valueAsNumber = Date.UTC(275760, 8, 13, 0, 0, 0, 1) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 26 28 Step attribute value and string representation: 27 29 PASS input.step = "1"; setValueAsNumberAndGetValue(2010, 0, 21, 0, 0, 0, 0) is "2010-01-21T00:00:00" -
trunk/LayoutTests/fast/forms/input-valueasnumber-month-expected.txt
r54120 r66355 15 15 PASS setValueAsNumberAndGetValue(2009, 12) is "2009-12" 16 16 PASS setValueAsNumberAndGetValue(10000, 1) is "10000-01" 17 PASS setValueAsNumberAndGetValue( 794, 9) is ""18 PASS setValueAsNumberAndGetValue( 1582, 9) is ""19 PASS setValueAsNumberAndGetValue(1 582, 10) is "1582-10"20 PASS setValueAsNumberAndGetValue(1 582, 11) is "1582-11"17 PASS setValueAsNumberAndGetValue(-1, 1) is "" 18 PASS setValueAsNumberAndGetValue(0, 12) is "" 19 PASS setValueAsNumberAndGetValue(1, 1) is "0001-01" 20 PASS setValueAsNumberAndGetValue(1, 2) is "0001-02" 21 21 PASS setValueAsNumberAndGetValue(275760, 9) is "275760-09" 22 PASS setValueAsNumberAndGetValue(2 147483647, 12) is "2147483647-12"22 PASS setValueAsNumberAndGetValue(275760, 10) is "" 23 23 Tests to set invalid values to valueAsNumber: 24 24 PASS input.value = ""; input.valueAsNumber = null; input.value is "1970-01" -
trunk/LayoutTests/fast/forms/input-valueasnumber-week-expected.txt
r53893 r66355 27 27 PASS setValueAsNumberAndGetValue(2010, 0, 17) is "2010-W02" 28 28 PASS setValueAsNumberAndGetValue(2010, 11, 31) is "2010-W52" 29 Around Gregorian calendar starting year: 30 PASS setValueAsNumberAndGetValue(1582, 9, 14) is "" 31 PASS setValueAsNumberAndGetValue(1582, 9, 15) is "" 32 PASS setValueAsNumberAndGetValue(1582, 11, 31) is "" 33 PASS setValueAsNumberAndGetValue(1583, 0, 1) is "" 34 PASS setValueAsNumberAndGetValue(1583, 0, 2) is "" 35 PASS setValueAsNumberAndGetValue(1583, 0, 3) is "1583-W01" 29 Around the minimum/maximum values: 30 PASS setValueAsNumberAndGetValue(0, 11, 31) is "" 31 PASS setValueAsNumberAndGetValue(1, 0, 1) is "0001-W01" 32 PASS setValueAsNumberAndGetValue(275760, 8, 8) is "275760-W37" 33 PASS setValueAsNumberAndGetValue(275760, 8, 13) is "275760-W37" 36 34 Tests to set invalid values to valueAsNumber: 37 35 PASS input.value = ""; input.valueAsNumber = null; input.value is "1970-W01" … … 42 40 PASS input.valueAsNumber = Number.POSITIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 43 41 PASS input.valueAsNumber = Number.NEGATIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 42 PASS input.valueAsNumber = Date.UTC(275760, 8, 14) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9. 44 43 PASS successfullyParsed is true 45 44 -
trunk/LayoutTests/fast/forms/script-tests/ValidityState-rangeOverflow.js
r56242 r66355 49 49 checkNotOverflow('2010-01-27', '2011-01-26'); 50 50 checkNotOverflow('foo', '2011-01-26'); 51 checkNotOverflow('2010-01-27', ' 1000-01-01'); // Too small max value.51 checkNotOverflow('2010-01-27', '0000-01-01'); // Too small max value. 52 52 53 53 // Overflow cases … … 70 70 checkNotOverflow('2010-01-27T12:34Z', '2011-01-26T12:34Z'); 71 71 checkNotOverflow('foo', '2011-01-26T12:34Z'); 72 checkNotOverflow('2010-01-27T12:34Z', ' 1000-01-01T00:00Z'); // Too small max value.72 checkNotOverflow('2010-01-27T12:34Z', '0000-01-01T00:00Z'); // Too small max value. 73 73 74 74 // Overflow cases … … 91 91 checkNotOverflow('2010-01-27T12:34', '2011-01-26T12:34'); 92 92 checkNotOverflow('foo', '2011-01-26T12:34'); 93 checkNotOverflow('2010-01-27T12:34', ' 1000-01-01T00:00'); // Too small max value.93 checkNotOverflow('2010-01-27T12:34', '0000-01-01T00:00'); // Too small max value. 94 94 95 95 // Overflow cases … … 112 112 checkNotOverflow('2010-01', '2011-01'); 113 113 checkNotOverflow('foo', '2011-01'); 114 checkNotOverflow('2010-01', ' 1000-01'); // Too small max value.114 checkNotOverflow('2010-01', '0000-01'); // Too small max value. 115 115 116 116 // Overflow cases … … 176 176 checkNotOverflow('2010-W01', '2011-W01'); 177 177 checkNotOverflow('foo', '2011-W01'); 178 checkNotOverflow('2010-W01', ' 1582-W01'); // Too smallmax value.178 checkNotOverflow('2010-W01', '0000-W01'); // Invalid max value. 179 179 180 180 // Overflow cases 181 checkOverflow('2010-W01', '1582-W01'); 181 182 checkOverflow('2010-W01', '2009-W12'); 182 183 checkOverflow('9999-W01', '2010-W12'); -
trunk/LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js
r55423 r66355 53 53 shouldBeFalse('stepMismatchFor("2010-02-09T12:34Z", "86400", "2010-02-08T12:34Z")'); 54 54 shouldBeTrue('stepMismatchFor("2010-02-09T12:34:56Z", "86400", "2010-02-08T12:34Z")'); 55 shouldBeTrue('stepMismatchFor("275760-09-13T00:00Z", "3", "275760-09-13T23:50:50Z")'); 56 shouldBeFalse('stepMismatchFor("275760-09-13T00:00Z", "2", "275760-09-13T23:50:50Z")'); 55 shouldBeTrue('stepMismatchFor("275760-09-13T00:00Z", "3", "275760-09-12T23:59:50Z")'); 56 shouldBeFalse('stepMismatchFor("275760-09-13T00:00Z", "2", "275760-09-12T23:59:50Z")'); 57 shouldBeTrue('stepMismatchFor("0001-01-01T00:00Z", "3", "0001-01-11T00:00:02Z")'); 58 shouldBeFalse('stepMismatchFor("0001-01-01T00:00Z", "2", "0001-01-11T00:00:02Z")'); 57 59 debug('Implicit step base'); 58 60 shouldBeFalse('stepMismatchFor("1970-01-01T12:34Z", "120", null)'); … … 83 85 shouldBeFalse('stepMismatchFor("2010-02-09T12:34", "86400", "2010-02-08T12:34")'); 84 86 shouldBeTrue('stepMismatchFor("2010-02-09T12:34:56", "86400", "2010-02-08T12:34")'); 85 shouldBeTrue('stepMismatchFor("275760-09-13T00:00", "3", "275760-09-13T23:50:50")'); 86 shouldBeFalse('stepMismatchFor("275760-09-13T00:00", "2", "275760-09-13T23:50:50")'); 87 shouldBeTrue('stepMismatchFor("275760-09-13T00:00", "3", "275760-09-12T23:59:50")'); 88 shouldBeFalse('stepMismatchFor("275760-09-13T00:00", "2", "275760-09-12T23:59:50")'); 89 shouldBeTrue('stepMismatchFor("0001-01-01T00:00", "3", "0001-01-11T00:00:02")'); 90 shouldBeFalse('stepMismatchFor("0001-01-01T00:00", "2", "0001-01-11T00:00:02")'); 87 91 debug('Implicit step base'); 88 92 shouldBeFalse('stepMismatchFor("1970-01-01T12:34", "120", null)'); -
trunk/LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-date.js
r51163 r66355 29 29 shouldBeValid('2009-09-07'); 30 30 shouldBeValid('9999-12-31'); 31 shouldBeValid('2 147483647-12-31');31 shouldBeValid('275760-09-13'); 32 32 shouldBeValid('1582-10-15'); 33 shouldBeValid('0001-01-01'); 33 34 shouldBeValid('2009-01-31'); 34 35 shouldBeValid('2009-02-28'); … … 50 51 shouldBeInvalid('a'); 51 52 shouldBeInvalid('-1-09-07'); 52 shouldBeInvalid('1581-09-07'); 53 shouldBeInvalid('1582-10-14'); 53 shouldBeInvalid('0000-12-31'); 54 shouldBeInvalid('0000-01-01'); 55 shouldBeInvalid('275760-09-14'); 54 56 shouldBeInvalid('2147483648-12-31'); 55 57 shouldBeInvalid('2009/09/07'); … … 58 60 shouldBeInvalid('2009-00-07'); 59 61 shouldBeInvalid('2009-13-07'); 60 shouldBeInvalid('1582-09-30');61 62 shouldBeInvalid('2009-xx-30'); 62 63 shouldBeInvalid('2009-01-32'); -
trunk/LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-datetime.js
r51163 r66355 33 33 shouldBeValid('2009-09-07T16:49:31.123Z'); 34 34 shouldBeValid('2009-09-07T16:49:31.1234567890Z'); 35 shouldBeValid('2147483647-12-31T23:59:59.999Z'); 36 shouldBeValid('1582-10-15T00:00:00.000Z'); 37 shouldBeValid('1582-10-15T00:00:00.000+00:00'); 38 shouldBeValid('1582-10-15T01:30+01:30'); 39 shouldBeValid('1582-10-15T00:00+01:00'); 35 shouldBeValid('275760-09-12T23:59:59.999Z'); 36 shouldBeValid('275760-09-13T00:00:00.000Z'); 37 shouldBeValid('0001-01-01T00:00:00.000Z'); 38 shouldBeValid('0001-01-01T00:00:00.000+00:00'); 39 shouldBeValid('0001-01-01T01:30+01:30'); 40 shouldBeValid('0001-01-01T00:00+01:00'); 40 41 41 42 // Invalid values … … 55 56 shouldBeInvalid('2009-09-07T16:49-24:00'); 56 57 shouldBeInvalid('2009-09-07T16:49-23:60'); 57 shouldBeInvalid(' 1582-10-14T23:59:59Z');58 shouldBeInvalid('0000-12-31T23:59:59Z'); 58 59 shouldBeInvalid('2147483647-12-31T23:59-00:01'); 59 60 shouldBeInvalid('2147483648-01-01T00:00:00Z'); -
trunk/LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-datetimelocal.js
r51163 r66355 33 33 shouldBeValid('2009-09-07T16:49:31.123'); 34 34 shouldBeValid('2009-09-07T16:49:31.1234567890'); 35 shouldBeValid('2 147483647-12-31T23:59:59.999');36 shouldBeValid(' 1582-10-15T00:00:00.000');35 shouldBeValid('275760-09-13T00:00:00.000'); 36 shouldBeValid('0001-01-01T00:00:00.000'); 37 37 38 38 // Invalid values … … 43 43 shouldBeInvalid('a'); 44 44 shouldBeInvalid('-1-09-07T16:49'); 45 shouldBeInvalid(' 1582-10-14T23:59:59');46 shouldBeInvalid('2 147483648-01-01T00:00:00');45 shouldBeInvalid('0000-12-31T23:59:59.999'); 46 shouldBeInvalid('275760-09-13T00:00:00.001'); 47 47 48 48 var successfullyParsed = true; -
trunk/LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-month.js
r51163 r66355 27 27 // Valid values 28 28 shouldBeValid(''); 29 shouldBeValid(' 1582-10');29 shouldBeValid('0001-01'); 30 30 shouldBeValid('9999-12'); 31 shouldBeValid('2 147483647-12');31 shouldBeValid('275760-09'); 32 32 shouldBeValid('2009-01'); 33 33 shouldBeValid('2009-02'); … … 47 47 shouldBeInvalid('a'); 48 48 shouldBeInvalid('-1-09'); 49 shouldBeInvalid('1581-10'); 50 shouldBeInvalid('1582-09'); 49 shouldBeInvalid('0000-12'); 51 50 shouldBeInvalid('2147483648-12'); 51 shouldBeInvalid('275760-10'); 52 52 shouldBeInvalid('2009/09'); 53 53 shouldBeInvalid('200909'); -
trunk/LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-week.js
r51163 r66355 27 27 // Valid values 28 28 shouldBeValid(''); 29 shouldBeValid('0001-W01'); 29 30 shouldBeValid('1583-W01'); 30 31 shouldBeValid('9999-W52'); 31 shouldBeValid('2 147483647-W52');32 shouldBeValid('275760-W37'); 32 33 shouldBeValid('2009-W01'); 33 34 shouldBeValid('2004-W53'); // 2004 started on Thursday. … … 43 44 shouldBeInvalid('a'); 44 45 shouldBeInvalid('-1-W09'); 45 shouldBeInvalid(' 1582-W52');46 shouldBeInvalid('0000-W52'); 46 47 shouldBeInvalid('2147483648-W01'); 48 shouldBeInvalid('275760-W38'); 47 49 shouldBeInvalid('2009-W00'); 48 50 shouldBeInvalid('2009-W-1'); -
trunk/LayoutTests/fast/forms/script-tests/input-valueasdate-date.js
r53606 r66355 12 12 var date = new Date(); 13 13 date.setTime(Date.UTC(year, month, day)); 14 if (year < 100) 15 date.setUTCFullYear(year); 14 16 input.valueAsDate = date; 15 17 return input.value; … … 26 28 shouldBe('setValueAsDateAndGetValue(10000, 0, 1)', '"10000-01-01"'); 27 29 28 shouldBe('setValueAsDateAndGetValue(794, 9, 22)', '""'); 29 shouldBe('setValueAsDateAndGetValue(1582, 8, 30)', '""'); 30 shouldBe('setValueAsDateAndGetValue(-1, 0, 1)', '""'); 31 shouldBe('setValueAsDateAndGetValue(0, 11, 31)', '""'); 32 shouldBe('setValueAsDateAndGetValue(1, 0, 1)', '"0001-01-01"'); 30 33 shouldBe('setValueAsDateAndGetValue(1582, 9, 15)', '"1582-10-15"'); 31 34 shouldBe('setValueAsDateAndGetValue(1582, 9, 31)', '"1582-10-31"'); -
trunk/LayoutTests/fast/forms/script-tests/input-valueasdate-datetime.js
r54647 r66355 12 12 var date = new Date(); 13 13 date.setTime(Date.UTC(year, month, day, hour, minute, second, msec)); 14 if (year < 100) 15 date.setUTCFullYear(year); 14 16 input.valueAsDate = date; 15 17 return input.value; … … 26 28 shouldBe('setValueAsDateAndGetValue(10000, 0, 1, 12, 0, 1, 0)', '"10000-01-01T12:00:01Z"'); 27 29 28 shouldBe('setValueAsDateAndGetValue( 794, 9, 22, 0, 0, 0, 0)', '""');29 shouldBe('setValueAsDateAndGetValue( 1582, 9, 14, 23, 59, 59, 999)', '""');30 shouldBe('setValueAsDateAndGetValue(1 582, 9, 15, 0, 0, 0, 0)', '"1582-10-15T00:00Z"');30 shouldBe('setValueAsDateAndGetValue(-1, 9, 22, 0, 0, 0, 0)', '""'); 31 shouldBe('setValueAsDateAndGetValue(0, 11, 31, 23, 59, 59, 999)', '""'); 32 shouldBe('setValueAsDateAndGetValue(1, 0, 1, 0, 0, 0, 0)', '"0001-01-01T00:00Z"'); 31 33 shouldBe('setValueAsDateAndGetValue(275760, 8, 13, 0, 0, 0, 0)', '"275760-09-13T00:00Z"'); 32 34 shouldBe('setValueAsDateAndGetValue(275760, 8, 13, 0, 0, 0, 1)', '""'); // Date of JavaScript can't represent this. -
trunk/LayoutTests/fast/forms/script-tests/input-valueasdate-month.js
r53445 r66355 12 12 var date = new Date(); 13 13 date.setTime(Date.UTC(year, month, day)); 14 if (year < 100) 15 date.setUTCFullYear(year); 14 16 input.valueAsDate = date; 15 17 return input.value; … … 26 28 shouldBe('setValueAsDateAndGetValue(10000, 0, 1)', '"10000-01"'); 27 29 28 shouldBe('setValueAsDateAndGetValue( 794, 9, 22)', '""');29 shouldBe('setValueAsDateAndGetValue( 1582, 8, 30)', '""');30 shouldBe('setValueAsDateAndGetValue( 1582, 9, 1)', '"1582-10"');31 shouldBe('setValueAsDateAndGetValue( 1582, 9, 31)', '"1582-10"');30 shouldBe('setValueAsDateAndGetValue(-1, 9, 22)', '""'); 31 shouldBe('setValueAsDateAndGetValue(0, 11, 30)', '""'); 32 shouldBe('setValueAsDateAndGetValue(0001, 0, 1)', '"0001-01"'); 33 shouldBe('setValueAsDateAndGetValue(0001, 0, 31)', '"0001-01"'); 32 34 shouldBe('setValueAsDateAndGetValue(275760, 8, 13)', '"275760-09"'); 33 35 shouldBe('setValueAsDateAndGetValue(275760, 8, 14)', '""'); // Date of JavaScript can't represent this. -
trunk/LayoutTests/fast/forms/script-tests/input-valueasdate-week.js
r53787 r66355 12 12 var date = new Date(); 13 13 date.setTime(Date.UTC(year, month, day)); 14 if (year < 100) 15 date.setUTCFullYear(year); 14 16 input.valueAsDate = date; 15 17 return input.value; … … 33 35 34 36 debug('Various January 1st:'); 37 shouldBe('setValueAsDateAndGetValue(1, 0, 1)', '"0001-W01"'); 35 38 shouldBe('setValueAsDateAndGetValue(2007, 0, 1)', '"2007-W01"'); 36 39 shouldBe('setValueAsDateAndGetValue(2008, 0, 1)', '"2008-W01"'); … … 49 52 shouldBe('setValueAsDateAndGetValue(2010, 11, 31)', '"2010-W52"'); 50 53 51 debug('Around Gregorian calendar starting year:');54 debug('Around the minimum value:'); 52 55 // Gregorian calendar started in 1582. We don't support that year. 53 shouldBe('setValueAsDateAndGetValue(1582, 9, 14)', '""'); 54 shouldBe('setValueAsDateAndGetValue(1582, 9, 15)', '""'); 55 shouldBe('setValueAsDateAndGetValue(1582, 11, 31)', '""'); 56 // January 1st is Saturday. W01 starts on January 3rd. 57 shouldBe('setValueAsDateAndGetValue(1583, 0, 1)', '""'); 58 shouldBe('setValueAsDateAndGetValue(1583, 0, 2)', '""'); 59 shouldBe('setValueAsDateAndGetValue(1583, 0, 3)', '"1583-W01"'); 56 shouldBe('setValueAsDateAndGetValue(0, 11, 31)', '""'); 57 shouldBe('setValueAsDateAndGetValue(0, 0, 1)', '""'); 60 58 61 59 var successfullyParsed = true; -
trunk/LayoutTests/fast/forms/script-tests/input-valueasnumber-date.js
r53991 r66355 10 10 11 11 function setValueAsNumberAndGetValue(year, month, day) { 12 input.valueAsNumber = Date.UTC(year, month, day); 12 var date = new Date(); 13 date.setTime(Date.UTC(year, month, day)); 14 if (year < 100) 15 date.setUTCFullYear(year); 16 input.valueAsNumber = date.getTime(); 13 17 return input.value; 14 18 } … … 24 28 shouldBe('setValueAsNumberAndGetValue(10000, 0, 1)', '"10000-01-01"'); 25 29 26 shouldBe('setValueAsNumberAndGetValue(794, 9, 22)', '""'); 27 shouldBe('setValueAsNumberAndGetValue(1582, 8, 30)', '""'); 28 shouldBe('setValueAsNumberAndGetValue(1582, 9, 15)', '"1582-10-15"'); 29 shouldBe('setValueAsNumberAndGetValue(1582, 9, 31)', '"1582-10-31"'); 30 shouldBe('setValueAsNumberAndGetValue(-1, 0, 1)', '""'); 31 shouldBe('setValueAsNumberAndGetValue(0, 11, 31)', '""'); 32 shouldBe('setValueAsNumberAndGetValue(1, 0, 1)', '"0001-01-01"'); 30 33 shouldBe('setValueAsNumberAndGetValue(275760, 8, 13)', '"275760-09-13"'); 31 // Date.UTC() of V8 throws an exception for the following value though JavaScriptCore doesn't.32 // shouldBe('setValueAsNumberAndGetValue(275760, 8, 14)', '"275760-09-14"');33 34 34 35 debug('Tests to set invalid values to valueAsNumber:'); … … 40 41 shouldThrow('input.valueAsNumber = Number.POSITIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"'); 41 42 shouldThrow('input.valueAsNumber = Number.NEGATIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"'); 43 shouldThrow('input.valueAsNumber = Date.UTC(275760, 8, 14)', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"'); 42 44 43 45 var successfullyParsed = true; -
trunk/LayoutTests/fast/forms/script-tests/input-valueasnumber-datetime.js
r54647 r66355 10 10 11 11 function setValueAsNumberAndGetValue(year, month, day, hour, minute, second, msec) { 12 input.valueAsNumber = Date.UTC(year, month, day, hour, minute, second, msec); 12 var date = new Date(); 13 date.setTime(Date.UTC(year, month, day, hour, minute, second, msec)); 14 if (year < 100) 15 date.setUTCFullYear(year); 16 input.valueAsNumber = date.getTime(); 13 17 return input.value; 14 18 } … … 24 28 shouldBe('setValueAsNumberAndGetValue(10000, 0, 1, 12, 0, 1, 0)', '"10000-01-01T12:00:01Z"'); 25 29 26 shouldBe('setValueAsNumberAndGetValue( 794, 9, 22, 0, 0, 0, 0)', '""');27 shouldBe('setValueAsNumberAndGetValue( 1582, 9, 14, 23, 59, 59, 999)', '""');28 shouldBe('setValueAsNumberAndGetValue(1 582, 9, 15, 0, 0, 0, 0)', '"1582-10-15T00:00Z"');30 shouldBe('setValueAsNumberAndGetValue(-1, 0, 1, 0, 0, 0, 0)', '""'); 31 shouldBe('setValueAsNumberAndGetValue(0, 11, 31, 23, 59, 59, 999)', '""'); 32 shouldBe('setValueAsNumberAndGetValue(1, 0, 1, 0, 0, 0, 0)', '"0001-01-01T00:00Z"'); 29 33 shouldBe('setValueAsNumberAndGetValue(275760, 8, 12, 0, 0, 0, 1)', '"275760-09-12T00:00:00.001Z"'); 30 34 shouldBe('setValueAsNumberAndGetValue(275760, 8, 13, 0, 0, 0, 0)', '"275760-09-13T00:00Z"'); 31 // Date.UTC() of V8 throws an exception for the following value though JavaScriptCore doesn't.32 // shouldBe('setValueAsNumberAndGetValue(275760, 8, 13, 0, 0, 0, 1)', '"275760-09-13T00:00:00.001Z"');33 35 34 36 debug('Tests to set invalid values to valueAsNumber:'); … … 40 42 shouldThrow('input.valueAsNumber = Number.POSITIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"'); 41 43 shouldThrow('input.valueAsNumber = Number.NEGATIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"'); 44 shouldThrow('input.valueAsNumber = Date.UTC(275760, 8, 13, 0, 0, 0, 1)', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"'); 42 45 43 46 debug('Step attribute value and string representation:'); -
trunk/LayoutTests/fast/forms/script-tests/input-valueasnumber-datetimelocal.js
r53991 r66355 10 10 11 11 function setValueAsNumberAndGetValue(year, month, day, hour, minute, second, msec) { 12 input.valueAsNumber = Date.UTC(year, month, day, hour, minute, second, msec); 12 var date = new Date(); 13 date.setTime(Date.UTC(year, month, day, hour, minute, second, msec)); 14 if (year < 100) 15 date.setUTCFullYear(year); 16 input.valueAsNumber = date.getTime(); 13 17 return input.value; 14 18 } … … 24 28 shouldBe('setValueAsNumberAndGetValue(10000, 0, 1, 12, 0, 1, 0)', '"10000-01-01T12:00:01"'); 25 29 26 shouldBe('setValueAsNumberAndGetValue(794, 9, 22, 0, 0, 0, 0)', '""'); 27 shouldBe('setValueAsNumberAndGetValue(1582, 9, 14, 23, 59, 59, 999)', '""'); 28 shouldBe('setValueAsNumberAndGetValue(1582, 9, 15, 0, 0, 0, 0)', '"1582-10-15T00:00"'); 30 shouldBe('setValueAsNumberAndGetValue(-1, 0, 1, 0, 0, 0, 0)', '""'); 31 shouldBe('setValueAsNumberAndGetValue(0, 11, 31, 23, 59, 59, 999)', '""'); 32 shouldBe('setValueAsNumberAndGetValue(1, 0, 1, 0, 0, 0, 0)', '"0001-01-01T00:00"'); 33 shouldBe('setValueAsNumberAndGetValue(275760, 8, 12, 0, 0, 0, 1)', '"275760-09-12T00:00:00.001"'); 29 34 shouldBe('setValueAsNumberAndGetValue(275760, 8, 13, 0, 0, 0, 0)', '"275760-09-13T00:00"'); 30 // Date.UTC() of V8 throws an exception for the following value though JavaScriptCore doesn't.31 // shouldBe('setValueAsNumberAndGetValue(275760, 8, 13, 0, 0, 0, 1)', '"275760-09-13T00:00:00.001"');32 35 33 36 debug('Tests to set invalid values to valueAsNumber:'); … … 39 42 shouldThrow('input.valueAsNumber = Number.POSITIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"'); 40 43 shouldThrow('input.valueAsNumber = Number.NEGATIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"'); 44 shouldThrow('input.valueAsNumber = Date.UTC(275760, 8, 13, 0, 0, 0, 1)', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"'); 41 45 42 46 debug('Step attribute value and string representation:'); -
trunk/LayoutTests/fast/forms/script-tests/input-valueasnumber-month.js
r54120 r66355 27 27 shouldBe('setValueAsNumberAndGetValue(10000, 1)', '"10000-01"'); 28 28 29 shouldBe('setValueAsNumberAndGetValue( 794, 9)', '""');30 shouldBe('setValueAsNumberAndGetValue( 1582, 9)', '""');31 shouldBe('setValueAsNumberAndGetValue(1 582, 10)', '"1582-10"');32 shouldBe('setValueAsNumberAndGetValue(1 582, 11)', '"1582-11"');29 shouldBe('setValueAsNumberAndGetValue(-1, 1)', '""'); 30 shouldBe('setValueAsNumberAndGetValue(0, 12)', '""'); 31 shouldBe('setValueAsNumberAndGetValue(1, 1)', '"0001-01"'); 32 shouldBe('setValueAsNumberAndGetValue(1, 2)', '"0001-02"'); 33 33 shouldBe('setValueAsNumberAndGetValue(275760, 9)', '"275760-09"'); 34 shouldBe('setValueAsNumberAndGetValue(2 147483647, 12)', '"2147483647-12"');34 shouldBe('setValueAsNumberAndGetValue(275760, 10)', '""'); 35 35 36 36 // Date.UTC() of V8 throws an exception for the following value though JavaScriptCore doesn't. -
trunk/LayoutTests/fast/forms/script-tests/input-valueasnumber-week.js
r53893 r66355 10 10 11 11 function setValueAsNumberAndGetValue(year, month, day) { 12 input.valueAsNumber = Date.UTC(year, month, day); 12 var date = new Date(); 13 date.setTime(Date.UTC(year, month, day)); 14 if (year < 100) 15 date.setUTCFullYear(year); 16 input.valueAsNumber = date.getTime(); 13 17 return input.value; 14 18 } … … 47 51 shouldBe('setValueAsNumberAndGetValue(2010, 11, 31)', '"2010-W52"'); 48 52 49 debug('Around Gregorian calendar starting year:'); 50 // Gregorian calendar started in 1582. We don't support that year. 51 shouldBe('setValueAsNumberAndGetValue(1582, 9, 14)', '""'); 52 shouldBe('setValueAsNumberAndGetValue(1582, 9, 15)', '""'); 53 shouldBe('setValueAsNumberAndGetValue(1582, 11, 31)', '""'); 54 // January 1st is Saturday. W01 starts on January 3rd. 55 shouldBe('setValueAsNumberAndGetValue(1583, 0, 1)', '""'); 56 shouldBe('setValueAsNumberAndGetValue(1583, 0, 2)', '""'); 57 shouldBe('setValueAsNumberAndGetValue(1583, 0, 3)', '"1583-W01"'); 53 debug('Around the minimum/maximum values:'); 54 shouldBe('setValueAsNumberAndGetValue(0, 11, 31)', '""'); 55 shouldBe('setValueAsNumberAndGetValue(1, 0, 1)', '"0001-W01"'); 56 shouldBe('setValueAsNumberAndGetValue(275760, 8, 8)', '"275760-W37"'); 57 shouldBe('setValueAsNumberAndGetValue(275760, 8, 13)', '"275760-W37"'); 58 58 59 59 debug('Tests to set invalid values to valueAsNumber:'); … … 65 65 shouldThrow('input.valueAsNumber = Number.POSITIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"'); 66 66 shouldThrow('input.valueAsNumber = Number.NEGATIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"'); 67 shouldThrow('input.valueAsNumber = Date.UTC(275760, 8, 14)', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"'); 67 68 68 69 var successfullyParsed = true; -
trunk/WebCore/ChangeLog
r66348 r66355 1 2010-08-29 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Change lower and higher limits of date/datetime/datetime-local/month/week types 6 https://bugs.webkit.org/show_bug.cgi?id=39737 7 8 According to the latest draft of HTML5, ISO-8601 dates in HTML5 9 should support A.D.0001 in Gregorian calendar though Gregorian 10 calendar started in 1582. So, we change the lower limits of 11 date&time types to 0001-01-01T00:00. 12 13 We also introduce the common higher limit, 275760-09-13T00:00. It 14 is the higher limit of Date type of ECMAScript. 15 16 * html/DateComponents.cpp: 17 (WebCore::DateComponents::parseYear): 18 Rejects years less than A.D.1 and years greater than 275760. 19 (WebCore::withinHTMLDateLimits): 20 Helper functions to check lower and higher limits. 21 (WebCore::DateComponents::addDay): 22 - Remove an overflow check. 'year' can't be so large number because 23 parseYear() rejects such numbers. 24 - Add withinHTMLDateLimits() calls. 25 (WebCore::DateComponents::addMinute): 26 - Add an assertion for the base date. 27 - Add withinHTMLDateLimits() calls. 28 (WebCore::DateComponents::parseMonth): 29 Add withinHTMLDateLimits() call. 30 (WebCore::DateComponents::parseDate): ditto. 31 (WebCore::DateComponents::parseWeek): ditto. 32 (WebCore::DateComponents::parseDateTimeLocal): ditto. 33 (WebCore::DateComponents::parseDateTime): ditto. 34 (WebCore::DateComponents::setMillisecondsSinceEpochForDate): ditto. 35 (WebCore::DateComponents::setMillisecondsSinceEpochForDateTime): ditto. 36 (WebCore::DateComponents::setMillisecondsSinceEpochForMonth): ditto. 37 (WebCore::DateComponents::setMonthsSinceEpoch): 38 Add year range check and withinHTMLDateLimits() call. 39 (WebCore::DateComponents::setMillisecondsSinceEpochForWeek): 40 Add year range check and week range check. 41 * html/DateComponents.h: 42 Update minimum/maximum constant values. 43 (WebCore::DateComponents::minimumDate): 44 (WebCore::DateComponents::minimumDateTime): 45 (WebCore::DateComponents::minimumMonth): 46 (WebCore::DateComponents::minimumWeek): 47 (WebCore::DateComponents::maximumDate): 48 (WebCore::DateComponents::maximumDateTime): 49 (WebCore::DateComponents::maximumMonth): 50 (WebCore::DateComponents::maximumWeek): 51 1 52 2010-08-29 Kwang Yul Seo <skyul@company100.net> 2 53 -
trunk/WebCore/html/DateComponents.cpp
r55058 r66355 42 42 namespace WebCore { 43 43 44 // The oldest day of Gregorian Calendar is 1582-10-15. We don't support dates older than it. 45 static const int gregorianStartYear = 1582; 46 static const int gregorianStartMonth = 9; // This is October, since months are 0 based. 47 static const int gregorianStartDay = 15; 44 // HTML5 uses ISO-8601 format with year >= 1. Gregorian calendar started in 45 // 1582. However, we need to support 0001-01-01 in Gregorian calendar rule. 46 static const int minimumYear = 1; 47 // Date in ECMAScript can't represent dates later than 275760-09-13T00:00Z. 48 // So, we have the same upper limit in HTML5 dates. 49 static const int maximumYear = 275760; 50 static const int maximumMonthInMaximumYear = 8; // This is September, since months are 0 based. 51 static const int maximumDayInMaximumMonth = 13; 52 static const int maximumWeekInMaximumYear = 37; // The week of 275760-09-13 48 53 49 54 static const int daysInMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; … … 135 140 if (!toInt(src, length, start, digitsLength, year)) 136 141 return false; 137 // No support for years before Gregorian calendar. 138 if (year < gregorianStartYear) 142 if (year < minimumYear || year > maximumYear) 139 143 return false; 140 144 m_year = year; … … 143 147 } 144 148 145 static bool beforeGregorianStartDate(int year, int month, int monthDay) 146 { 147 return year < gregorianStartYear 148 || (year == gregorianStartYear && month < gregorianStartMonth) 149 || (year == gregorianStartYear && month == gregorianStartMonth && monthDay < gregorianStartDay); 149 static bool withinHTMLDateLimits(int year, int month) 150 { 151 if (year < minimumYear) 152 return false; 153 if (year < maximumYear) 154 return true; 155 return month <= maximumMonthInMaximumYear; 156 } 157 158 static bool withinHTMLDateLimits(int year, int month, int monthDay) 159 { 160 if (year < minimumYear) 161 return false; 162 if (year < maximumYear) 163 return true; 164 if (month < maximumMonthInMaximumYear) 165 return true; 166 return monthDay <= maximumDayInMaximumMonth; 167 } 168 169 static bool withinHTMLDateLimits(int year, int month, int monthDay, int hour, int minute, int second, int millisecond) 170 { 171 if (year < minimumYear) 172 return false; 173 if (year < maximumYear) 174 return true; 175 if (month < maximumMonthInMaximumYear) 176 return true; 177 if (monthDay < maximumDayInMaximumMonth) 178 return true; 179 if (monthDay > maximumDayInMaximumMonth) 180 return false; 181 // (year, month, monthDay) = (maximumYear, maximumMonthInMaximumYear, maximumDayInMaximumMonth) 182 return !hour && !minute && !second && !millisecond; 150 183 } 151 184 … … 168 201 month = 0; 169 202 ++year; 170 if (year < 0) // Check for overflow.171 return false;172 203 } 173 204 maxDay = maxDayOfMonth(year, month); 174 205 } 175 206 } 207 if (!withinHTMLDateLimits(year, month, day)) 208 return false; 176 209 m_year = year; 177 210 m_month = month; … … 190 223 day = maxDayOfMonth(year, month); 191 224 } 192 if (beforeGregorianStartDate(year, month, day))193 return false;194 225 } 226 if (!withinHTMLDateLimits(year, month, day)) 227 return false; 195 228 m_year = year; 196 229 m_month = month; 230 } else { 231 if (!withinHTMLDateLimits(m_year, m_month, day)) 232 return false; 197 233 } 198 234 m_monthDay = day; … … 202 238 bool DateComponents::addMinute(int minute) 203 239 { 240 // This function is used to adjust timezone offset. So m_year, m_month, 241 // m_monthDay have values between the lower and higher limits. 242 ASSERT(withinHTMLDateLimits(m_year, m_month, m_monthDay)); 243 204 244 int carry; 205 // min can be negative or greater than 59.245 // minute can be negative or greater than 59. 206 246 minute += m_minute; 207 247 if (minute > 59) { … … 214 254 ASSERT(minute >= 0 && minute <= 59); 215 255 } else { 256 if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, m_hour, minute, m_second, m_millisecond)) 257 return false; 216 258 m_minute = minute; 217 259 return true; … … 228 270 ASSERT(hour >= 0 && hour <= 23); 229 271 } else { 272 if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, hour, minute, m_second, m_millisecond)) 273 return false; 230 274 m_minute = minute; 231 275 m_hour = hour; … … 233 277 } 234 278 if (!addDay(carry)) 279 return false; 280 if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, hour, minute, m_second, m_millisecond)) 235 281 return false; 236 282 m_minute = minute; … … 299 345 return false; 300 346 --month; 301 // No support for months before Gregorian calendar. 302 if (beforeGregorianStartDate(m_year, month, gregorianStartDay)) 347 if (!withinHTMLDateLimits(m_year, month)) 303 348 return false; 304 349 m_month = month; … … 324 369 if (!toInt(src, length, index, 2, day) || day < 1 || day > maxDayOfMonth(m_year, m_month)) 325 370 return false; 326 // No support for dates before Gregorian calendar. 327 if (m_year == gregorianStartYear && m_month == gregorianStartMonth && day < gregorianStartDay) 371 if (!withinHTMLDateLimits(m_year, m_month, day)) 328 372 return false; 329 373 m_monthDay = day; … … 353 397 if (!toInt(src, length, index, 2, week) || week < 1 || week > maxWeekNumberInYear()) 354 398 return false; 355 // No support for years older than or equals to Gregorian calendar start year. 356 if (m_year <= gregorianStartYear) 399 if (m_year == maximumYear && week > maximumWeekInMaximumYear) 357 400 return false; 358 401 m_week = week; … … 430 473 if (!parseTime(src, length, index, end)) 431 474 return false; 475 if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, m_hour, m_minute, m_second, m_millisecond)) 476 return false; 432 477 m_type = DateTimeLocal; 433 478 return true; … … 448 493 return false; 449 494 if (!parseTimeZone(src, length, index, end)) 495 return false; 496 if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, m_hour, m_minute, m_second, m_millisecond)) 450 497 return false; 451 498 m_type = DateTime; … … 486 533 if (!setMillisecondsSinceEpochForDateInternal(round(ms))) 487 534 return false; 488 if ( beforeGregorianStartDate(m_year, m_month, m_monthDay))535 if (!withinHTMLDateLimits(m_year, m_month, m_monthDay)) 489 536 return false; 490 537 m_type = Date; … … 501 548 if (!setMillisecondsSinceEpochForDateInternal(ms)) 502 549 return false; 503 if ( beforeGregorianStartDate(m_year, m_month, m_monthDay))550 if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, m_hour, m_minute, m_second, m_millisecond)) 504 551 return false; 505 552 m_type = DateTime; … … 523 570 if (!setMillisecondsSinceEpochForDateInternal(round(ms))) 524 571 return false; 525 // Ignore m_monthDay updated by setMillisecondsSinceEpochForDateInternal(). 526 if (beforeGregorianStartDate(m_year, m_month, gregorianStartDay)) 572 if (!withinHTMLDateLimits(m_year, m_month)) 527 573 return false; 528 574 m_type = Month; … … 547 593 double doubleMonth = positiveFmod(months, 12); 548 594 double doubleYear = 1970 + (months - doubleMonth) / 12; 549 if (doubleYear < gregorianStartYear || numeric_limits<int>::max()< doubleYear)595 if (doubleYear < minimumYear || maximumYear < doubleYear) 550 596 return false; 551 597 int year = static_cast<int>(doubleYear); 552 598 int month = static_cast<int>(doubleMonth); 553 if ( beforeGregorianStartDate(year, month, gregorianStartDay))599 if (!withinHTMLDateLimits(year, month)) 554 600 return false; 555 601 m_year = year; … … 577 623 578 624 m_year = msToYear(ms); 579 // We don't support gregorianStartYear. Week numbers are undefined in that year. 580 if (m_year <= gregorianStartYear) 625 if (m_year < minimumYear || m_year > maximumYear) 581 626 return false; 582 627 … … 586 631 // The day belongs to the last week of the previous year. 587 632 m_year--; 588 if (m_year <= gregorianStartYear)633 if (m_year <= minimumYear) 589 634 return false; 590 635 m_week = maxWeekNumberInYear(); … … 595 640 m_week = 1; 596 641 } 642 if (m_year > maximumYear || m_year == maximumYear && m_week > maximumWeekInMaximumYear) 643 return false; 597 644 } 598 645 m_type = Week; -
trunk/WebCore/html/DateComponents.h
r65021 r66355 138 138 // Minimum and maxmimum limits for setMillisecondsSince*(), 139 139 // setMonthsSinceEpoch(), millisecondsSinceEpoch(), and monthsSinceEpoch(). 140 static inline double minimumDate() { return - 12219292800000.0; } // This means 1582-10-15T00:00Z.141 static inline double minimumDateTime() { return - 12219292800000.0; } // ditto.142 static inline double minimumMonth() { return (1 582.0 - 1970) * 12 + 10 - 1; } // 1582-10140 static inline double minimumDate() { return -62135596800000.0; } // 0001-01-01T00:00Z 141 static inline double minimumDateTime() { return -62135596800000.0; } // ditto. 142 static inline double minimumMonth() { return (1 - 1970) * 12.0 + 1 - 1; } // 0001-01 143 143 static inline double minimumTime() { return 0; } // 00:00:00.000 144 static inline double minimumWeek() { return -12212380800000.0; } // 1583-01-03, the first Monday of 1583. 145 static inline double maximumDate() { return std::numeric_limits<double>::max(); } 146 static inline double maximumDateTime() { return std::numeric_limits<double>::max(); } 147 // DateComponents::m_year can't represent a year greater than INT_MAX. 148 static inline double maximumMonth() { return (std::numeric_limits<int>::max() - 1970) * 12.0 + 12 - 1; } 144 static inline double minimumWeek() { return -62135596800000.0; } // 0001-01-01, the first Monday of 0001. 145 static inline double maximumDate() { return 8640000000000000.0; } // 275760-09-13T00:00Z 146 static inline double maximumDateTime() { return 8640000000000000.0; } // ditto. 147 static inline double maximumMonth() { return (275760 - 1970) * 12.0 + 9 - 1; } // 275760-09 149 148 static inline double maximumTime() { return 86399999; } // 23:59:59.999 150 static inline double maximumWeek() { return std::numeric_limits<double>::max(); }149 static inline double maximumWeek() { return 8639999568000000.0; } // 275760-09-08, the Monday of the week including 275760-09-13. 151 150 152 151 private:
Note: See TracChangeset
for help on using the changeset viewer.