Changeset 53445 in webkit for trunk/JavaScriptCore/wtf/DateMath.h


Ignore:
Timestamp:
Jan 18, 2010, 5:49:42 PM (15 years ago)
Author:
[email protected]
Message:

2010-01-18 Kent Tamura <[email protected]>

Reviewed by Darin Adler.

HTMLInputElement::valueAsDate setter support for type=month.
https://bugs.webkit.org/show_bug.cgi?id=33021

Expose the following functions to be used by WebCore:

  • WTF::msToyear()
  • WTF::dayInYear()
  • WTF::monthFromDayInYear()
  • WTF::dayInMonthFromDayInYear()
  • JavaScriptCore.exp:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  • wtf/DateMath.cpp: (WTF::msToYear): Remove "static inline". (WTF::dayInYear): Remove "static inline". (WTF::monthFromDayInYear): Remove "static inline". (WTF::dayInMonthFromDayInYear): Remove "static inline".
  • wtf/DateMath.h: Declare the above functions.

2010-01-18 Kent Tamura <[email protected]>

Reviewed by Darin Adler.

HTMLInputElement::valueAsDate setter support for type=month.
https://bugs.webkit.org/show_bug.cgi?id=33021

Add setter tests to input-valueasdate-month.js, and update the
expectation.

  • fast/forms/input-valueasdate-expected.txt:
  • fast/forms/input-valueasdate-month-expected.txt:
  • fast/forms/script-tests/input-valueasdate-month.js:
  • fast/forms/script-tests/input-valueasdate.js:

2010-01-18 Kent Tamura <[email protected]>

Reviewed by Darin Adler.

HTMLInputElement::valueAsDate setter support for type=month.
https://bugs.webkit.org/show_bug.cgi?id=33021

Introduce ISODateTime::setMillisecondsSinceEpochForMonth() and
toString() for the Month type, and HTMLInputElement::setValueAsDate()
calls them.

  • html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setValueAsDate):
  • html/ISODateTime.cpp: (WebCore::beforeGregorianStartDate): (WebCore::ISODateTime::addDay): Use beforeGregorianStartDate(). (WebCore::ISODateTime::parseMonth): Use beforeGregorianStartDate(). (WebCore::ISODateTime::setMillisecondsSinceEpochForDateInternal): (WebCore::ISODateTime::setMillisecondsSinceEpochForMonth): (WebCore::ISODateTime::toString): Implement only for the Month type.
  • html/ISODateTime.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/DateMath.h

    r52524 r53445  
    7979// Returns the number of days from 1970-01-01 to the specified date.
    8080double dateToDaysFrom1970(int year, int month, int day);
     81int msToYear(double ms);
     82int dayInYear(double ms, int year);
     83int monthFromDayInYear(int dayInYear, bool leapYear);
     84int dayInMonthFromDayInYear(int dayInYear, bool leapYear);
    8185
    8286} // namespace WTF
    8387
    8488using WTF::dateToDaysFrom1970;
     89using WTF::dayInMonthFromDayInYear;
     90using WTF::dayInYear;
    8591using WTF::minutesPerHour;
     92using WTF::monthFromDayInYear;
    8693using WTF::msPerDay;
    8794using WTF::msPerSecond;
     95using WTF::msToYear;
    8896using WTF::secondsPerMinute;
    8997
Note: See TracChangeset for help on using the changeset viewer.