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.cpp

    r52791 r53445  
    173173}
    174174
    175 static inline int msToYear(double ms)
     175int msToYear(double ms)
    176176{
    177177    int approxYear = static_cast<int>(floor(ms / (msPerDay * 365.2425)) + 1970);
     
    184184}
    185185
    186 static inline int dayInYear(double ms, int year)
     186int dayInYear(double ms, int year)
    187187{
    188188    return static_cast<int>(msToDays(ms) - daysFrom1970ToYear(year));
     
    230230}
    231231
    232 static inline int monthFromDayInYear(int dayInYear, bool leapYear)
     232int monthFromDayInYear(int dayInYear, bool leapYear)
    233233{
    234234    const int d = dayInYear;
     
    268268}
    269269
    270 static inline int dayInMonthFromDayInYear(int dayInYear, bool leapYear)
     270int dayInMonthFromDayInYear(int dayInYear, bool leapYear)
    271271{
    272272    const int d = dayInYear;
Note: See TracChangeset for help on using the changeset viewer.