Changeset 66355 in webkit


Ignore:
Timestamp:
Aug 29, 2010 9:47:24 PM (14 years ago)
Author:
tkent@chromium.org
Message:

Change lower and higher limits of date/datetime/datetime-local/month/week types
https://bugs.webkit.org/show_bug.cgi?id=39737

Reviewed by Darin Adler.

WebCore:

According to the latest draft of HTML5, ISO-8601 dates in HTML5
should support A.D.0001 in Gregorian calendar though Gregorian
calendar started in 1582. So, we change the lower limits of
date&time types to 0001-01-01T00:00.

We also introduce the common higher limit, 275760-09-13T00:00. It
is the higher limit of Date type of ECMAScript.

  • html/DateComponents.cpp:

(WebCore::DateComponents::parseYear):

Rejects years less than A.D.1 and years greater than 275760.

(WebCore::withinHTMLDateLimits):

Helper functions to check lower and higher limits.

(WebCore::DateComponents::addDay):

  • Remove an overflow check. 'year' can't be so large number because parseYear() rejects such numbers.
  • Add withinHTMLDateLimits() calls.

(WebCore::DateComponents::addMinute):

  • Add an assertion for the base date.
  • Add withinHTMLDateLimits() calls.

(WebCore::DateComponents::parseMonth):

Add withinHTMLDateLimits() call.

(WebCore::DateComponents::parseDate): ditto.
(WebCore::DateComponents::parseWeek): ditto.
(WebCore::DateComponents::parseDateTimeLocal): ditto.
(WebCore::DateComponents::parseDateTime): ditto.
(WebCore::DateComponents::setMillisecondsSinceEpochForDate): ditto.
(WebCore::DateComponents::setMillisecondsSinceEpochForDateTime): ditto.
(WebCore::DateComponents::setMillisecondsSinceEpochForMonth): ditto.
(WebCore::DateComponents::setMonthsSinceEpoch):

Add year range check and withinHTMLDateLimits() call.

(WebCore::DateComponents::setMillisecondsSinceEpochForWeek):

Add year range check and week range check.

  • html/DateComponents.h: Update minimum/maximum constant values.

(WebCore::DateComponents::minimumDate):
(WebCore::DateComponents::minimumDateTime):
(WebCore::DateComponents::minimumMonth):
(WebCore::DateComponents::minimumWeek):
(WebCore::DateComponents::maximumDate):
(WebCore::DateComponents::maximumDateTime):
(WebCore::DateComponents::maximumMonth):
(WebCore::DateComponents::maximumWeek):

LayoutTests:

Update tests and test results for the new DateComponents behavior.

  • fast/forms/ValidityState-rangeOverflow-expected.txt:
  • fast/forms/ValidityState-stepMismatch-expected.txt:
  • fast/forms/ValidityState-typeMismatch-date-expected.txt:
  • fast/forms/ValidityState-typeMismatch-datetime-expected.txt:
  • fast/forms/ValidityState-typeMismatch-datetimelocal-expected.txt:
  • fast/forms/ValidityState-typeMismatch-month-expected.txt:
  • fast/forms/ValidityState-typeMismatch-week-expected.txt:
  • fast/forms/input-valueasdate-date-expected.txt:
  • fast/forms/input-valueasdate-datetime-expected.txt:
  • fast/forms/input-valueasdate-month-expected.txt:
  • fast/forms/input-valueasdate-week-expected.txt:
  • fast/forms/input-valueasnumber-date-expected.txt:
  • fast/forms/input-valueasnumber-datetime-expected.txt:
  • fast/forms/input-valueasnumber-datetimelocal-expected.txt:
  • fast/forms/input-valueasnumber-month-expected.txt:
  • fast/forms/input-valueasnumber-week-expected.txt:
  • fast/forms/script-tests/ValidityState-rangeOverflow.js:
  • fast/forms/script-tests/ValidityState-stepMismatch.js:
  • fast/forms/script-tests/ValidityState-typeMismatch-date.js:
  • fast/forms/script-tests/ValidityState-typeMismatch-datetime.js:
  • fast/forms/script-tests/ValidityState-typeMismatch-datetimelocal.js:
  • fast/forms/script-tests/ValidityState-typeMismatch-month.js:
  • fast/forms/script-tests/ValidityState-typeMismatch-week.js:
  • fast/forms/script-tests/input-valueasdate-date.js:
  • fast/forms/script-tests/input-valueasdate-datetime.js:
  • fast/forms/script-tests/input-valueasdate-month.js:
  • fast/forms/script-tests/input-valueasdate-week.js:
  • fast/forms/script-tests/input-valueasnumber-date.js:
  • fast/forms/script-tests/input-valueasnumber-datetime.js:
  • fast/forms/script-tests/input-valueasnumber-datetimelocal.js:
  • fast/forms/script-tests/input-valueasnumber-month.js:
  • fast/forms/script-tests/input-valueasnumber-week.js:
Location:
trunk
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r66354 r66355  
     12010-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
    1432010-08-29  Yuzo Fujishima  <yuzo@google.com>
    244
  • trunk/LayoutTests/fast/forms/ValidityState-rangeOverflow-expected.txt

    r56242 r66355  
    1515PASS The value "2010-01-27" doesn't overflow the maximum value "2011-01-26".
    1616PASS 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".
     17PASS The value "2010-01-27" doesn't overflow the maximum value "0000-01-01".
    1818PASS The value "2010-01-27" overflows the maximum value "2010-01-26".
    1919PASS The value "9999-01-01" overflows the maximum value "2010-12-31".
     
    2828PASS The value "2010-01-27T12:34Z" doesn't overflow the maximum value "2011-01-26T12:34Z".
    2929PASS 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".
     30PASS The value "2010-01-27T12:34Z" doesn't overflow the maximum value "0000-01-01T00:00Z".
    3131PASS The value "2010-01-27T12:34Z" overflows the maximum value "2010-01-26T12:33:59.999Z".
    3232PASS The value "9999-01-01T23:59Z" overflows the maximum value "2010-12-31T00:00Z".
     
    4141PASS The value "2010-01-27T12:34" doesn't overflow the maximum value "2011-01-26T12:34".
    4242PASS 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".
     43PASS The value "2010-01-27T12:34" doesn't overflow the maximum value "0000-01-01T00:00".
    4444PASS The value "2010-01-27T12:34" overflows the maximum value "2010-01-26T12:33:59.999".
    4545PASS The value "9999-01-01T23:59" overflows the maximum value "2010-12-31T00:00".
     
    5454PASS The value "2010-01" doesn't overflow the maximum value "2011-01".
    5555PASS 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".
     56PASS The value "2010-01" doesn't overflow the maximum value "0000-01".
    5757PASS The value "2010-01" overflows the maximum value "2009-12".
    5858PASS The value "9999-01" overflows the maximum value "2010-12".
     
    9494PASS The value "2010-W01" doesn't overflow the maximum value "2011-W01".
    9595PASS 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".
     96PASS The value "2010-W01" doesn't overflow the maximum value "0000-W01".
     97PASS The value "2010-W01" overflows the maximum value "1582-W01".
    9798PASS The value "2010-W01" overflows the maximum value "2009-W12".
    9899PASS The value "9999-W01" overflows the maximum value "2010-W12".
  • trunk/LayoutTests/fast/forms/ValidityState-stepMismatch-expected.txt

    r55423 r66355  
    4343PASS stepMismatchFor("2010-02-09T12:34Z", "86400", "2010-02-08T12:34Z") is false
    4444PASS 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
     45PASS stepMismatchFor("275760-09-13T00:00Z", "3", "275760-09-12T23:59:50Z") is true
     46PASS stepMismatchFor("275760-09-13T00:00Z", "2", "275760-09-12T23:59:50Z") is false
     47PASS stepMismatchFor("0001-01-01T00:00Z", "3", "0001-01-11T00:00:02Z") is true
     48PASS stepMismatchFor("0001-01-01T00:00Z", "2", "0001-01-11T00:00:02Z") is false
    4749Implicit step base
    4850PASS stepMismatchFor("1970-01-01T12:34Z", "120", null) is false
     
    7173PASS stepMismatchFor("2010-02-09T12:34", "86400", "2010-02-08T12:34") is false
    7274PASS 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
     75PASS stepMismatchFor("275760-09-13T00:00", "3", "275760-09-12T23:59:50") is true
     76PASS stepMismatchFor("275760-09-13T00:00", "2", "275760-09-12T23:59:50") is false
     77PASS stepMismatchFor("0001-01-01T00:00", "3", "0001-01-11T00:00:02") is true
     78PASS stepMismatchFor("0001-01-01T00:00", "2", "0001-01-11T00:00:02") is false
    7579Implicit step base
    7680PASS stepMismatchFor("1970-01-01T12:34", "120", null) is false
  • trunk/LayoutTests/fast/forms/ValidityState-typeMismatch-date-expected.txt

    r51163 r66355  
    77PASS "2009-09-07" is a correct valid date string.
    88PASS "9999-12-31" is a correct valid date string.
    9 PASS "2147483647-12-31" is a correct valid date string.
     9PASS "275760-09-13" is a correct valid date string.
    1010PASS "1582-10-15" is a correct valid date string.
     11PASS "0001-01-01" is a correct valid date string.
    1112PASS "2009-01-31" is a correct valid date string.
    1213PASS "2009-02-28" is a correct valid date string.
     
    2627PASS "a" is a correct invalid date string.
    2728PASS "-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.
     29PASS "0000-12-31" is a correct invalid date string.
     30PASS "0000-01-01" is a correct invalid date string.
     31PASS "275760-09-14" is a correct invalid date string.
    3032PASS "2147483648-12-31" is a correct invalid date string.
    3133PASS "2009/09/07" is a correct invalid date string.
     
    3436PASS "2009-00-07" is a correct invalid date string.
    3537PASS "2009-13-07" is a correct invalid date string.
    36 PASS "1582-09-30" is a correct invalid date string.
    3738PASS "2009-xx-30" is a correct invalid date string.
    3839PASS "2009-01-32" is a correct invalid date string.
  • trunk/LayoutTests/fast/forms/ValidityState-typeMismatch-datetime-expected.txt

    r51163 r66355  
    1111PASS "2009-09-07T16:49:31.123Z" is a correct valid datetime string.
    1212PASS "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.
     13PASS "275760-09-12T23:59:59.999Z" is a correct valid datetime string.
     14PASS "275760-09-13T00:00:00.000Z" is a correct valid datetime string.
     15PASS "0001-01-01T00:00:00.000Z" is a correct valid datetime string.
     16PASS "0001-01-01T00:00:00.000+00:00" is a correct valid datetime string.
     17PASS "0001-01-01T01:30+01:30" is a correct valid datetime string.
     18PASS "0001-01-01T00:00+01:00" is a correct valid datetime string.
    1819PASS " 2009-09-07T16:49Z " is a correct invalid datetime string.
    1920PASS "2009-09-07T16:49z" is a correct invalid datetime string.
     
    3132PASS "2009-09-07T16:49-24:00" is a correct invalid datetime string.
    3233PASS "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.
     34PASS "0000-12-31T23:59:59Z" is a correct invalid datetime string.
    3435PASS "2147483647-12-31T23:59-00:01" is a correct invalid datetime string.
    3536PASS "2147483648-01-01T00:00:00Z" is a correct invalid datetime string.
  • trunk/LayoutTests/fast/forms/ValidityState-typeMismatch-datetimelocal-expected.txt

    r51163 r66355  
    1111PASS "2009-09-07T16:49:31.123" is a correct valid datetime-local string.
    1212PASS "2009-09-07T16:49:31.1234567890" is a correct valid datetime-local string.
    13 PASS "2147483647-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.
     13PASS "275760-09-13T00:00:00.000" is a correct valid datetime-local string.
     14PASS "0001-01-01T00:00:00.000" is a correct valid datetime-local string.
    1515PASS " 2009-09-07T16:49 " is a correct invalid datetime-local string.
    1616PASS "2009-09-07t16:49" is a correct invalid datetime-local string.
     
    1919PASS "a" is a correct invalid datetime-local string.
    2020PASS "-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 "2147483648-01-01T00:00:00" is a correct invalid datetime-local string.
     21PASS "0000-12-31T23:59:59.999" is a correct invalid datetime-local string.
     22PASS "275760-09-13T00:00:00.001" is a correct invalid datetime-local string.
    2323PASS successfullyParsed is true
    2424
  • trunk/LayoutTests/fast/forms/ValidityState-typeMismatch-month-expected.txt

    r51163 r66355  
    55
    66PASS "" is a correct valid month string.
    7 PASS "1582-10" is a correct valid month string.
     7PASS "0001-01" is a correct valid month string.
    88PASS "9999-12" is a correct valid month string.
    9 PASS "2147483647-12" is a correct valid month string.
     9PASS "275760-09" is a correct valid month string.
    1010PASS "2009-01" is a correct valid month string.
    1111PASS "2009-02" is a correct valid month string.
     
    2323PASS "a" is a correct invalid month string.
    2424PASS "-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.
     25PASS "0000-12" is a correct invalid month string.
    2726PASS "2147483648-12" is a correct invalid month string.
     27PASS "275760-10" is a correct invalid month string.
    2828PASS "2009/09" is a correct invalid month string.
    2929PASS "200909" is a correct invalid month string.
  • trunk/LayoutTests/fast/forms/ValidityState-typeMismatch-week-expected.txt

    r51163 r66355  
    55
    66PASS "" is a correct valid week string.
     7PASS "0001-W01" is a correct valid week string.
    78PASS "1583-W01" is a correct valid week string.
    89PASS "9999-W52" is a correct valid week string.
    9 PASS "2147483647-W52" is a correct valid week string.
     10PASS "275760-W37" is a correct valid week string.
    1011PASS "2009-W01" is a correct valid week string.
    1112PASS "2004-W53" is a correct valid week string.
     
    1920PASS "a" is a correct invalid week string.
    2021PASS "-1-W09" is a correct invalid week string.
    21 PASS "1582-W52" is a correct invalid week string.
     22PASS "0000-W52" is a correct invalid week string.
    2223PASS "2147483648-W01" is a correct invalid week string.
     24PASS "275760-W38" is a correct invalid week string.
    2325PASS "2009-W00" is a correct invalid week string.
    2426PASS "2009-W-1" is a correct invalid week string.
  • trunk/LayoutTests/fast/forms/input-valueasdate-date-expected.txt

    r53606 r66355  
    1212PASS setValueAsDateAndGetValue(2009, 11, 31) is "2009-12-31"
    1313PASS setValueAsDateAndGetValue(10000, 0, 1) is "10000-01-01"
    14 PASS setValueAsDateAndGetValue(794, 9, 22) is ""
    15 PASS setValueAsDateAndGetValue(1582, 8, 30) is ""
     14PASS setValueAsDateAndGetValue(-1, 0, 1) is ""
     15PASS setValueAsDateAndGetValue(0, 11, 31) is ""
     16PASS setValueAsDateAndGetValue(1, 0, 1) is "0001-01-01"
    1617PASS setValueAsDateAndGetValue(1582, 9, 15) is "1582-10-15"
    1718PASS setValueAsDateAndGetValue(1582, 9, 31) is "1582-10-31"
  • trunk/LayoutTests/fast/forms/input-valueasdate-datetime-expected.txt

    r54647 r66355  
    1212PASS setValueAsDateAndGetValue(2009, 11, 31, 23, 59, 59, 999) is "2009-12-31T23:59:59.999Z"
    1313PASS 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(1582, 9, 15, 0, 0, 0, 0) is "1582-10-15T00:00Z"
     14PASS setValueAsDateAndGetValue(-1, 9, 22, 0, 0, 0, 0) is ""
     15PASS setValueAsDateAndGetValue(0, 11, 31, 23, 59, 59, 999) is ""
     16PASS setValueAsDateAndGetValue(1, 0, 1, 0, 0, 0, 0) is "0001-01-01T00:00Z"
    1717PASS setValueAsDateAndGetValue(275760, 8, 13, 0, 0, 0, 0) is "275760-09-13T00:00Z"
    1818PASS setValueAsDateAndGetValue(275760, 8, 13, 0, 0, 0, 1) is ""
  • trunk/LayoutTests/fast/forms/input-valueasdate-month-expected.txt

    r53445 r66355  
    1212PASS setValueAsDateAndGetValue(2009, 11, 31) is "2009-12"
    1313PASS 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"
     14PASS setValueAsDateAndGetValue(-1, 9, 22) is ""
     15PASS setValueAsDateAndGetValue(0, 11, 30) is ""
     16PASS setValueAsDateAndGetValue(0001, 0, 1) is "0001-01"
     17PASS setValueAsDateAndGetValue(0001, 0, 31) is "0001-01"
    1818PASS setValueAsDateAndGetValue(275760, 8, 13) is "275760-09"
    1919PASS setValueAsDateAndGetValue(275760, 8, 14) is ""
  • trunk/LayoutTests/fast/forms/input-valueasdate-week-expected.txt

    r53787 r66355  
    1313PASS valueAsDateFor("2006-W01").getTime() is Date.UTC(2006, 0, 2)
    1414Various January 1st:
     15PASS setValueAsDateAndGetValue(1, 0, 1) is "0001-W01"
    1516PASS setValueAsDateAndGetValue(2007, 0, 1) is "2007-W01"
    1617PASS setValueAsDateAndGetValue(2008, 0, 1) is "2008-W01"
     
    2728PASS setValueAsDateAndGetValue(2010, 0, 17) is "2010-W02"
    2829PASS 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"
     30Around the minimum value:
     31PASS setValueAsDateAndGetValue(0, 11, 31) is ""
     32PASS setValueAsDateAndGetValue(0, 0, 1) is ""
    3633PASS successfullyParsed is true
    3734
  • trunk/LayoutTests/fast/forms/input-valueasnumber-date-expected.txt

    r53991 r66355  
    1212PASS setValueAsNumberAndGetValue(2009, 11, 31) is "2009-12-31"
    1313PASS 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"
     14PASS setValueAsNumberAndGetValue(-1, 0, 1) is ""
     15PASS setValueAsNumberAndGetValue(0, 11, 31) is ""
     16PASS setValueAsNumberAndGetValue(1, 0, 1) is "0001-01-01"
    1817PASS setValueAsNumberAndGetValue(275760, 8, 13) is "275760-09-13"
    1918Tests to set invalid values to valueAsNumber:
     
    2524PASS input.valueAsNumber = Number.POSITIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    2625PASS input.valueAsNumber = Number.NEGATIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
     26PASS input.valueAsNumber = Date.UTC(275760, 8, 14) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    2727PASS successfullyParsed is true
    2828
  • trunk/LayoutTests/fast/forms/input-valueasnumber-datetime-expected.txt

    r54647 r66355  
    1212PASS setValueAsNumberAndGetValue(2009, 11, 31, 23, 59, 59, 999) is "2009-12-31T23:59:59.999Z"
    1313PASS 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(1582, 9, 15, 0, 0, 0, 0) is "1582-10-15T00:00Z"
     14PASS setValueAsNumberAndGetValue(-1, 0, 1, 0, 0, 0, 0) is ""
     15PASS setValueAsNumberAndGetValue(0, 11, 31, 23, 59, 59, 999) is ""
     16PASS setValueAsNumberAndGetValue(1, 0, 1, 0, 0, 0, 0) is "0001-01-01T00:00Z"
    1717PASS setValueAsNumberAndGetValue(275760, 8, 12, 0, 0, 0, 1) is "275760-09-12T00:00:00.001Z"
    1818PASS setValueAsNumberAndGetValue(275760, 8, 13, 0, 0, 0, 0) is "275760-09-13T00:00Z"
     
    2525PASS input.valueAsNumber = Number.POSITIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    2626PASS input.valueAsNumber = Number.NEGATIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
     27PASS input.valueAsNumber = Date.UTC(275760, 8, 13, 0, 0, 0, 1) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    2728Step attribute value and string representation:
    2829PASS 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  
    1212PASS setValueAsNumberAndGetValue(2009, 11, 31, 23, 59, 59, 999) is "2009-12-31T23:59:59.999"
    1313PASS 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"
     14PASS setValueAsNumberAndGetValue(-1, 0, 1, 0, 0, 0, 0) is ""
     15PASS setValueAsNumberAndGetValue(0, 11, 31, 23, 59, 59, 999) is ""
     16PASS setValueAsNumberAndGetValue(1, 0, 1, 0, 0, 0, 0) is "0001-01-01T00:00"
     17PASS setValueAsNumberAndGetValue(275760, 8, 12, 0, 0, 0, 1) is "275760-09-12T00:00:00.001"
    1718PASS setValueAsNumberAndGetValue(275760, 8, 13, 0, 0, 0, 0) is "275760-09-13T00:00"
    1819Tests to set invalid values to valueAsNumber:
     
    2425PASS input.valueAsNumber = Number.POSITIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    2526PASS input.valueAsNumber = Number.NEGATIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
     27PASS input.valueAsNumber = Date.UTC(275760, 8, 13, 0, 0, 0, 1) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    2628Step attribute value and string representation:
    2729PASS 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  
    1515PASS setValueAsNumberAndGetValue(2009, 12) is "2009-12"
    1616PASS setValueAsNumberAndGetValue(10000, 1) is "10000-01"
    17 PASS setValueAsNumberAndGetValue(794, 9) is ""
    18 PASS setValueAsNumberAndGetValue(1582, 9) is ""
    19 PASS setValueAsNumberAndGetValue(1582, 10) is "1582-10"
    20 PASS setValueAsNumberAndGetValue(1582, 11) is "1582-11"
     17PASS setValueAsNumberAndGetValue(-1, 1) is ""
     18PASS setValueAsNumberAndGetValue(0, 12) is ""
     19PASS setValueAsNumberAndGetValue(1, 1) is "0001-01"
     20PASS setValueAsNumberAndGetValue(1, 2) is "0001-02"
    2121PASS setValueAsNumberAndGetValue(275760, 9) is "275760-09"
    22 PASS setValueAsNumberAndGetValue(2147483647, 12) is "2147483647-12"
     22PASS setValueAsNumberAndGetValue(275760, 10) is ""
    2323Tests to set invalid values to valueAsNumber:
    2424PASS input.value = ""; input.valueAsNumber = null; input.value is "1970-01"
  • trunk/LayoutTests/fast/forms/input-valueasnumber-week-expected.txt

    r53893 r66355  
    2727PASS setValueAsNumberAndGetValue(2010, 0, 17) is "2010-W02"
    2828PASS 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"
     29Around the minimum/maximum values:
     30PASS setValueAsNumberAndGetValue(0, 11, 31) is ""
     31PASS setValueAsNumberAndGetValue(1, 0, 1) is "0001-W01"
     32PASS setValueAsNumberAndGetValue(275760, 8, 8) is "275760-W37"
     33PASS setValueAsNumberAndGetValue(275760, 8, 13) is "275760-W37"
    3634Tests to set invalid values to valueAsNumber:
    3735PASS input.value = ""; input.valueAsNumber = null; input.value is "1970-W01"
     
    4240PASS input.valueAsNumber = Number.POSITIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    4341PASS input.valueAsNumber = Number.NEGATIVE_INFINITY threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
     42PASS input.valueAsNumber = Date.UTC(275760, 8, 14) threw exception Error: NOT_SUPPORTED_ERR: DOM Exception 9.
    4443PASS successfullyParsed is true
    4544
  • trunk/LayoutTests/fast/forms/script-tests/ValidityState-rangeOverflow.js

    r56242 r66355  
    4949checkNotOverflow('2010-01-27', '2011-01-26');
    5050checkNotOverflow('foo', '2011-01-26');
    51 checkNotOverflow('2010-01-27', '1000-01-01'); // Too small max value.
     51checkNotOverflow('2010-01-27', '0000-01-01'); // Too small max value.
    5252
    5353// Overflow cases
     
    7070checkNotOverflow('2010-01-27T12:34Z', '2011-01-26T12:34Z');
    7171checkNotOverflow('foo', '2011-01-26T12:34Z');
    72 checkNotOverflow('2010-01-27T12:34Z', '1000-01-01T00:00Z'); // Too small max value.
     72checkNotOverflow('2010-01-27T12:34Z', '0000-01-01T00:00Z'); // Too small max value.
    7373
    7474// Overflow cases
     
    9191checkNotOverflow('2010-01-27T12:34', '2011-01-26T12:34');
    9292checkNotOverflow('foo', '2011-01-26T12:34');
    93 checkNotOverflow('2010-01-27T12:34', '1000-01-01T00:00'); // Too small max value.
     93checkNotOverflow('2010-01-27T12:34', '0000-01-01T00:00'); // Too small max value.
    9494
    9595// Overflow cases
     
    112112checkNotOverflow('2010-01', '2011-01');
    113113checkNotOverflow('foo', '2011-01');
    114 checkNotOverflow('2010-01', '1000-01'); // Too small max value.
     114checkNotOverflow('2010-01', '0000-01'); // Too small max value.
    115115
    116116// Overflow cases
     
    176176checkNotOverflow('2010-W01', '2011-W01');
    177177checkNotOverflow('foo', '2011-W01');
    178 checkNotOverflow('2010-W01', '1582-W01'); // Too small max value.
     178checkNotOverflow('2010-W01', '0000-W01'); // Invalid max value.
    179179
    180180// Overflow cases
     181checkOverflow('2010-W01', '1582-W01');
    181182checkOverflow('2010-W01', '2009-W12');
    182183checkOverflow('9999-W01', '2010-W12');
  • trunk/LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js

    r55423 r66355  
    5353shouldBeFalse('stepMismatchFor("2010-02-09T12:34Z", "86400", "2010-02-08T12:34Z")');
    5454shouldBeTrue('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")');
     55shouldBeTrue('stepMismatchFor("275760-09-13T00:00Z", "3", "275760-09-12T23:59:50Z")');
     56shouldBeFalse('stepMismatchFor("275760-09-13T00:00Z", "2", "275760-09-12T23:59:50Z")');
     57shouldBeTrue('stepMismatchFor("0001-01-01T00:00Z", "3", "0001-01-11T00:00:02Z")');
     58shouldBeFalse('stepMismatchFor("0001-01-01T00:00Z", "2", "0001-01-11T00:00:02Z")');
    5759debug('Implicit step base');
    5860shouldBeFalse('stepMismatchFor("1970-01-01T12:34Z", "120", null)');
     
    8385shouldBeFalse('stepMismatchFor("2010-02-09T12:34", "86400", "2010-02-08T12:34")');
    8486shouldBeTrue('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")');
     87shouldBeTrue('stepMismatchFor("275760-09-13T00:00", "3", "275760-09-12T23:59:50")');
     88shouldBeFalse('stepMismatchFor("275760-09-13T00:00", "2", "275760-09-12T23:59:50")');
     89shouldBeTrue('stepMismatchFor("0001-01-01T00:00", "3", "0001-01-11T00:00:02")');
     90shouldBeFalse('stepMismatchFor("0001-01-01T00:00", "2", "0001-01-11T00:00:02")');
    8791debug('Implicit step base');
    8892shouldBeFalse('stepMismatchFor("1970-01-01T12:34", "120", null)');
  • trunk/LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-date.js

    r51163 r66355  
    2929shouldBeValid('2009-09-07');
    3030shouldBeValid('9999-12-31');
    31 shouldBeValid('2147483647-12-31');
     31shouldBeValid('275760-09-13');
    3232shouldBeValid('1582-10-15');
     33shouldBeValid('0001-01-01');
    3334shouldBeValid('2009-01-31');
    3435shouldBeValid('2009-02-28');
     
    5051shouldBeInvalid('a');
    5152shouldBeInvalid('-1-09-07');
    52 shouldBeInvalid('1581-09-07');
    53 shouldBeInvalid('1582-10-14');
     53shouldBeInvalid('0000-12-31');
     54shouldBeInvalid('0000-01-01');
     55shouldBeInvalid('275760-09-14');
    5456shouldBeInvalid('2147483648-12-31');
    5557shouldBeInvalid('2009/09/07');
     
    5860shouldBeInvalid('2009-00-07');
    5961shouldBeInvalid('2009-13-07');
    60 shouldBeInvalid('1582-09-30');
    6162shouldBeInvalid('2009-xx-30');
    6263shouldBeInvalid('2009-01-32');
  • trunk/LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-datetime.js

    r51163 r66355  
    3333shouldBeValid('2009-09-07T16:49:31.123Z');
    3434shouldBeValid('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');
     35shouldBeValid('275760-09-12T23:59:59.999Z');
     36shouldBeValid('275760-09-13T00:00:00.000Z');
     37shouldBeValid('0001-01-01T00:00:00.000Z');
     38shouldBeValid('0001-01-01T00:00:00.000+00:00');
     39shouldBeValid('0001-01-01T01:30+01:30');
     40shouldBeValid('0001-01-01T00:00+01:00');
    4041
    4142// Invalid values
     
    5556shouldBeInvalid('2009-09-07T16:49-24:00');
    5657shouldBeInvalid('2009-09-07T16:49-23:60');
    57 shouldBeInvalid('1582-10-14T23:59:59Z');
     58shouldBeInvalid('0000-12-31T23:59:59Z');
    5859shouldBeInvalid('2147483647-12-31T23:59-00:01');
    5960shouldBeInvalid('2147483648-01-01T00:00:00Z');
  • trunk/LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-datetimelocal.js

    r51163 r66355  
    3333shouldBeValid('2009-09-07T16:49:31.123');
    3434shouldBeValid('2009-09-07T16:49:31.1234567890');
    35 shouldBeValid('2147483647-12-31T23:59:59.999');
    36 shouldBeValid('1582-10-15T00:00:00.000');
     35shouldBeValid('275760-09-13T00:00:00.000');
     36shouldBeValid('0001-01-01T00:00:00.000');
    3737
    3838// Invalid values
     
    4343shouldBeInvalid('a');
    4444shouldBeInvalid('-1-09-07T16:49');
    45 shouldBeInvalid('1582-10-14T23:59:59');
    46 shouldBeInvalid('2147483648-01-01T00:00:00');
     45shouldBeInvalid('0000-12-31T23:59:59.999');
     46shouldBeInvalid('275760-09-13T00:00:00.001');
    4747
    4848var successfullyParsed = true;
  • trunk/LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-month.js

    r51163 r66355  
    2727// Valid values
    2828shouldBeValid('');
    29 shouldBeValid('1582-10');
     29shouldBeValid('0001-01');
    3030shouldBeValid('9999-12');
    31 shouldBeValid('2147483647-12');
     31shouldBeValid('275760-09');
    3232shouldBeValid('2009-01');
    3333shouldBeValid('2009-02');
     
    4747shouldBeInvalid('a');
    4848shouldBeInvalid('-1-09');
    49 shouldBeInvalid('1581-10');
    50 shouldBeInvalid('1582-09');
     49shouldBeInvalid('0000-12');
    5150shouldBeInvalid('2147483648-12');
     51shouldBeInvalid('275760-10');
    5252shouldBeInvalid('2009/09');
    5353shouldBeInvalid('200909');
  • trunk/LayoutTests/fast/forms/script-tests/ValidityState-typeMismatch-week.js

    r51163 r66355  
    2727// Valid values
    2828shouldBeValid('');
     29shouldBeValid('0001-W01');
    2930shouldBeValid('1583-W01');
    3031shouldBeValid('9999-W52');
    31 shouldBeValid('2147483647-W52');
     32shouldBeValid('275760-W37');
    3233shouldBeValid('2009-W01');
    3334shouldBeValid('2004-W53');  // 2004 started on Thursday.
     
    4344shouldBeInvalid('a');
    4445shouldBeInvalid('-1-W09');
    45 shouldBeInvalid('1582-W52');
     46shouldBeInvalid('0000-W52');
    4647shouldBeInvalid('2147483648-W01');
     48shouldBeInvalid('275760-W38');
    4749shouldBeInvalid('2009-W00');
    4850shouldBeInvalid('2009-W-1');
  • trunk/LayoutTests/fast/forms/script-tests/input-valueasdate-date.js

    r53606 r66355  
    1212    var date = new Date();
    1313    date.setTime(Date.UTC(year, month, day));
     14    if (year < 100)
     15        date.setUTCFullYear(year);
    1416    input.valueAsDate = date;
    1517    return input.value;
     
    2628shouldBe('setValueAsDateAndGetValue(10000, 0, 1)', '"10000-01-01"');
    2729
    28 shouldBe('setValueAsDateAndGetValue(794, 9, 22)', '""');
    29 shouldBe('setValueAsDateAndGetValue(1582, 8, 30)', '""');
     30shouldBe('setValueAsDateAndGetValue(-1, 0, 1)', '""');
     31shouldBe('setValueAsDateAndGetValue(0, 11, 31)', '""');
     32shouldBe('setValueAsDateAndGetValue(1, 0, 1)', '"0001-01-01"');
    3033shouldBe('setValueAsDateAndGetValue(1582, 9, 15)', '"1582-10-15"');
    3134shouldBe('setValueAsDateAndGetValue(1582, 9, 31)', '"1582-10-31"');
  • trunk/LayoutTests/fast/forms/script-tests/input-valueasdate-datetime.js

    r54647 r66355  
    1212    var date = new Date();
    1313    date.setTime(Date.UTC(year, month, day, hour, minute, second, msec));
     14    if (year < 100)
     15        date.setUTCFullYear(year);
    1416    input.valueAsDate = date;
    1517    return input.value;
     
    2628shouldBe('setValueAsDateAndGetValue(10000, 0, 1, 12, 0, 1, 0)', '"10000-01-01T12:00:01Z"');
    2729
    28 shouldBe('setValueAsDateAndGetValue(794, 9, 22, 0, 0, 0, 0)', '""');
    29 shouldBe('setValueAsDateAndGetValue(1582, 9, 14, 23, 59, 59, 999)', '""');
    30 shouldBe('setValueAsDateAndGetValue(1582, 9, 15, 0, 0, 0, 0)', '"1582-10-15T00:00Z"');
     30shouldBe('setValueAsDateAndGetValue(-1, 9, 22, 0, 0, 0, 0)', '""');
     31shouldBe('setValueAsDateAndGetValue(0, 11, 31, 23, 59, 59, 999)', '""');
     32shouldBe('setValueAsDateAndGetValue(1, 0, 1, 0, 0, 0, 0)', '"0001-01-01T00:00Z"');
    3133shouldBe('setValueAsDateAndGetValue(275760, 8, 13, 0, 0, 0, 0)', '"275760-09-13T00:00Z"');
    3234shouldBe('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  
    1212    var date = new Date();
    1313    date.setTime(Date.UTC(year, month, day));
     14    if (year < 100)
     15        date.setUTCFullYear(year);
    1416    input.valueAsDate = date;
    1517    return input.value;
     
    2628shouldBe('setValueAsDateAndGetValue(10000, 0, 1)', '"10000-01"');
    2729
    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"');
     30shouldBe('setValueAsDateAndGetValue(-1, 9, 22)', '""');
     31shouldBe('setValueAsDateAndGetValue(0, 11, 30)', '""');
     32shouldBe('setValueAsDateAndGetValue(0001, 0, 1)', '"0001-01"');
     33shouldBe('setValueAsDateAndGetValue(0001, 0, 31)', '"0001-01"');
    3234shouldBe('setValueAsDateAndGetValue(275760, 8, 13)', '"275760-09"');
    3335shouldBe('setValueAsDateAndGetValue(275760, 8, 14)', '""'); // Date of JavaScript can't represent this.
  • trunk/LayoutTests/fast/forms/script-tests/input-valueasdate-week.js

    r53787 r66355  
    1212    var date = new Date();
    1313    date.setTime(Date.UTC(year, month, day));
     14    if (year < 100)
     15        date.setUTCFullYear(year);
    1416    input.valueAsDate = date;
    1517    return input.value;
     
    3335
    3436debug('Various January 1st:');
     37shouldBe('setValueAsDateAndGetValue(1, 0, 1)', '"0001-W01"');
    3538shouldBe('setValueAsDateAndGetValue(2007, 0, 1)', '"2007-W01"');
    3639shouldBe('setValueAsDateAndGetValue(2008, 0, 1)', '"2008-W01"');
     
    4952shouldBe('setValueAsDateAndGetValue(2010, 11, 31)', '"2010-W52"');
    5053
    51 debug('Around Gregorian calendar starting year:');
     54debug('Around the minimum value:');
    5255// 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"');
     56shouldBe('setValueAsDateAndGetValue(0, 11, 31)', '""');
     57shouldBe('setValueAsDateAndGetValue(0, 0, 1)', '""');
    6058
    6159var successfullyParsed = true;
  • trunk/LayoutTests/fast/forms/script-tests/input-valueasnumber-date.js

    r53991 r66355  
    1010
    1111function 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();
    1317    return input.value;
    1418}
     
    2428shouldBe('setValueAsNumberAndGetValue(10000, 0, 1)', '"10000-01-01"');
    2529
    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"');
     30shouldBe('setValueAsNumberAndGetValue(-1, 0, 1)', '""');
     31shouldBe('setValueAsNumberAndGetValue(0, 11, 31)', '""');
     32shouldBe('setValueAsNumberAndGetValue(1, 0, 1)', '"0001-01-01"');
    3033shouldBe('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"');
    3334
    3435debug('Tests to set invalid values to valueAsNumber:');
     
    4041shouldThrow('input.valueAsNumber = Number.POSITIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"');
    4142shouldThrow('input.valueAsNumber = Number.NEGATIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"');
     43shouldThrow('input.valueAsNumber = Date.UTC(275760, 8, 14)', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"');
    4244
    4345var successfullyParsed = true;
  • trunk/LayoutTests/fast/forms/script-tests/input-valueasnumber-datetime.js

    r54647 r66355  
    1010
    1111function 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();
    1317    return input.value;
    1418}
     
    2428shouldBe('setValueAsNumberAndGetValue(10000, 0, 1, 12, 0, 1, 0)', '"10000-01-01T12:00:01Z"');
    2529
    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:00Z"');
     30shouldBe('setValueAsNumberAndGetValue(-1, 0, 1, 0, 0, 0, 0)', '""');
     31shouldBe('setValueAsNumberAndGetValue(0, 11, 31, 23, 59, 59, 999)', '""');
     32shouldBe('setValueAsNumberAndGetValue(1, 0, 1, 0, 0, 0, 0)', '"0001-01-01T00:00Z"');
    2933shouldBe('setValueAsNumberAndGetValue(275760, 8, 12, 0, 0, 0, 1)', '"275760-09-12T00:00:00.001Z"');
    3034shouldBe('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"');
    3335
    3436debug('Tests to set invalid values to valueAsNumber:');
     
    4042shouldThrow('input.valueAsNumber = Number.POSITIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"');
    4143shouldThrow('input.valueAsNumber = Number.NEGATIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"');
     44shouldThrow('input.valueAsNumber = Date.UTC(275760, 8, 13, 0, 0, 0, 1)', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"');
    4245
    4346debug('Step attribute value and string representation:');
  • trunk/LayoutTests/fast/forms/script-tests/input-valueasnumber-datetimelocal.js

    r53991 r66355  
    1010
    1111function 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();
    1317    return input.value;
    1418}
     
    2428shouldBe('setValueAsNumberAndGetValue(10000, 0, 1, 12, 0, 1, 0)', '"10000-01-01T12:00:01"');
    2529
    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"');
     30shouldBe('setValueAsNumberAndGetValue(-1, 0, 1, 0, 0, 0, 0)', '""');
     31shouldBe('setValueAsNumberAndGetValue(0, 11, 31, 23, 59, 59, 999)', '""');
     32shouldBe('setValueAsNumberAndGetValue(1, 0, 1, 0, 0, 0, 0)', '"0001-01-01T00:00"');
     33shouldBe('setValueAsNumberAndGetValue(275760, 8, 12, 0, 0, 0, 1)', '"275760-09-12T00:00:00.001"');
    2934shouldBe('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"');
    3235
    3336debug('Tests to set invalid values to valueAsNumber:');
     
    3942shouldThrow('input.valueAsNumber = Number.POSITIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"');
    4043shouldThrow('input.valueAsNumber = Number.NEGATIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"');
     44shouldThrow('input.valueAsNumber = Date.UTC(275760, 8, 13, 0, 0, 0, 1)', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"');
    4145
    4246debug('Step attribute value and string representation:');
  • trunk/LayoutTests/fast/forms/script-tests/input-valueasnumber-month.js

    r54120 r66355  
    2727shouldBe('setValueAsNumberAndGetValue(10000, 1)', '"10000-01"');
    2828
    29 shouldBe('setValueAsNumberAndGetValue(794, 9)', '""');
    30 shouldBe('setValueAsNumberAndGetValue(1582, 9)', '""');
    31 shouldBe('setValueAsNumberAndGetValue(1582, 10)', '"1582-10"');
    32 shouldBe('setValueAsNumberAndGetValue(1582, 11)', '"1582-11"');
     29shouldBe('setValueAsNumberAndGetValue(-1, 1)', '""');
     30shouldBe('setValueAsNumberAndGetValue(0, 12)', '""');
     31shouldBe('setValueAsNumberAndGetValue(1, 1)', '"0001-01"');
     32shouldBe('setValueAsNumberAndGetValue(1, 2)', '"0001-02"');
    3333shouldBe('setValueAsNumberAndGetValue(275760, 9)', '"275760-09"');
    34 shouldBe('setValueAsNumberAndGetValue(2147483647, 12)', '"2147483647-12"');
     34shouldBe('setValueAsNumberAndGetValue(275760, 10)', '""');
    3535
    3636// 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  
    1010
    1111function 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();
    1317    return input.value;
    1418}
     
    4751shouldBe('setValueAsNumberAndGetValue(2010, 11, 31)', '"2010-W52"');
    4852
    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"');
     53debug('Around the minimum/maximum values:');
     54shouldBe('setValueAsNumberAndGetValue(0, 11, 31)', '""');
     55shouldBe('setValueAsNumberAndGetValue(1, 0, 1)', '"0001-W01"');
     56shouldBe('setValueAsNumberAndGetValue(275760, 8, 8)', '"275760-W37"');
     57shouldBe('setValueAsNumberAndGetValue(275760, 8, 13)', '"275760-W37"');
    5858
    5959debug('Tests to set invalid values to valueAsNumber:');
     
    6565shouldThrow('input.valueAsNumber = Number.POSITIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"');
    6666shouldThrow('input.valueAsNumber = Number.NEGATIVE_INFINITY', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"');
     67shouldThrow('input.valueAsNumber = Date.UTC(275760, 8, 14)', '"Error: NOT_SUPPORTED_ERR: DOM Exception 9"');
    6768
    6869var successfullyParsed = true;
  • trunk/WebCore/ChangeLog

    r66348 r66355  
     12010-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
    1522010-08-29  Kwang Yul Seo  <skyul@company100.net>
    253
  • trunk/WebCore/html/DateComponents.cpp

    r55058 r66355  
    4242namespace WebCore {
    4343
    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.
     46static 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.
     49static const int maximumYear = 275760;
     50static const int maximumMonthInMaximumYear = 8; // This is September, since months are 0 based.
     51static const int maximumDayInMaximumMonth = 13;
     52static const int maximumWeekInMaximumYear = 37; // The week of 275760-09-13
    4853
    4954static const int daysInMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
     
    135140    if (!toInt(src, length, start, digitsLength, year))
    136141        return false;
    137     // No support for years before Gregorian calendar.
    138     if (year < gregorianStartYear)
     142    if (year < minimumYear || year > maximumYear)
    139143        return false;
    140144    m_year = year;
     
    143147}
    144148
    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);
     149static 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
     158static 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
     169static 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;
    150183}
    151184
     
    168201                    month = 0;
    169202                    ++year;
    170                     if (year < 0) // Check for overflow.
    171                         return false;
    172203                }
    173204                maxDay = maxDayOfMonth(year, month);
    174205            }
    175206        }
     207        if (!withinHTMLDateLimits(year, month, day))
     208            return false;
    176209        m_year = year;
    177210        m_month = month;
     
    190223                day = maxDayOfMonth(year, month);
    191224            }
    192             if (beforeGregorianStartDate(year, month, day))
    193                 return false;
    194225        }
     226        if (!withinHTMLDateLimits(year, month, day))
     227            return false;
    195228        m_year = year;
    196229        m_month = month;
     230    } else {
     231        if (!withinHTMLDateLimits(m_year, m_month, day))
     232            return false;
    197233    }
    198234    m_monthDay = day;
     
    202238bool DateComponents::addMinute(int minute)
    203239{
     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
    204244    int carry;
    205     // min can be negative or greater than 59.
     245    // minute can be negative or greater than 59.
    206246    minute += m_minute;
    207247    if (minute > 59) {
     
    214254        ASSERT(minute >= 0 && minute <= 59);
    215255    } else {
     256        if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, m_hour, minute, m_second, m_millisecond))
     257            return false;
    216258        m_minute = minute;
    217259        return true;
     
    228270        ASSERT(hour >= 0 && hour <= 23);
    229271    } else {
     272        if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, hour, minute, m_second, m_millisecond))
     273            return false;
    230274        m_minute = minute;
    231275        m_hour = hour;
     
    233277    }
    234278    if (!addDay(carry))
     279        return false;
     280    if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, hour, minute, m_second, m_millisecond))
    235281        return false;
    236282    m_minute = minute;
     
    299345        return false;
    300346    --month;
    301     // No support for months before Gregorian calendar.
    302     if (beforeGregorianStartDate(m_year, month, gregorianStartDay))
     347    if (!withinHTMLDateLimits(m_year, month))
    303348        return false;
    304349    m_month = month;
     
    324369    if (!toInt(src, length, index, 2, day) || day < 1 || day > maxDayOfMonth(m_year, m_month))
    325370        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))
    328372        return false;
    329373    m_monthDay = day;
     
    353397    if (!toInt(src, length, index, 2, week) || week < 1 || week > maxWeekNumberInYear())
    354398        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)
    357400        return false;
    358401    m_week = week;
     
    430473    if (!parseTime(src, length, index, end))
    431474        return false;
     475    if (!withinHTMLDateLimits(m_year, m_month, m_monthDay, m_hour, m_minute, m_second, m_millisecond))
     476        return false;
    432477    m_type = DateTimeLocal;
    433478    return true;
     
    448493        return false;
    449494    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))
    450497        return false;
    451498    m_type = DateTime;
     
    486533    if (!setMillisecondsSinceEpochForDateInternal(round(ms)))
    487534        return false;
    488     if (beforeGregorianStartDate(m_year, m_month, m_monthDay))
     535    if (!withinHTMLDateLimits(m_year, m_month, m_monthDay))
    489536        return false;
    490537    m_type = Date;
     
    501548    if (!setMillisecondsSinceEpochForDateInternal(ms))
    502549        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))
    504551        return false;
    505552    m_type = DateTime;
     
    523570    if (!setMillisecondsSinceEpochForDateInternal(round(ms)))
    524571        return false;
    525     // Ignore m_monthDay updated by setMillisecondsSinceEpochForDateInternal().
    526     if (beforeGregorianStartDate(m_year, m_month, gregorianStartDay))
     572    if (!withinHTMLDateLimits(m_year, m_month))
    527573        return false;
    528574    m_type = Month;
     
    547593    double doubleMonth = positiveFmod(months, 12);
    548594    double doubleYear = 1970 + (months - doubleMonth) / 12;
    549     if (doubleYear < gregorianStartYear || numeric_limits<int>::max() < doubleYear)
     595    if (doubleYear < minimumYear || maximumYear < doubleYear)
    550596        return false;
    551597    int year = static_cast<int>(doubleYear);
    552598    int month = static_cast<int>(doubleMonth);
    553     if (beforeGregorianStartDate(year, month, gregorianStartDay))
     599    if (!withinHTMLDateLimits(year, month))
    554600        return false;
    555601    m_year = year;
     
    577623
    578624    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)
    581626        return false;
    582627
     
    586631        // The day belongs to the last week of the previous year.
    587632        m_year--;
    588         if (m_year <= gregorianStartYear)
     633        if (m_year <= minimumYear)
    589634            return false;
    590635        m_week = maxWeekNumberInYear();
     
    595640            m_week = 1;
    596641        }
     642        if (m_year > maximumYear || m_year == maximumYear && m_week > maximumWeekInMaximumYear)
     643            return false;
    597644    }
    598645    m_type = Week;
  • trunk/WebCore/html/DateComponents.h

    r65021 r66355  
    138138    // Minimum and maxmimum limits for setMillisecondsSince*(),
    139139    // 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 (1582.0 - 1970) * 12 + 10 - 1; } // 1582-10
     140    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
    143143    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
    149148    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.
    151150
    152151private:
Note: See TracChangeset for help on using the changeset viewer.