-
tkent@chromium.org authored
Reviewed by Darin Adler. Fix valueAsNumber calculation for type=month. https://bugs.webkit.org/show_bug.cgi?id=34304 valueAsNumber calculation for type=month which was checked in as r53893 was the number of milliseconds since UNIX epoch, and it was wrong. The correct way is the number months since UNIX epoch. * fast/forms/input-valueasnumber-month-expected.txt: * fast/forms/script-tests/input-valueasnumber-month.js: 2010-01-31 Kent Tamura <tkent@chromium.org> Reviewed by Darin Adler. Fix valueAsNumber calculation for type=month. https://bugs.webkit.org/show_bug.cgi?id=34304 valueAsNumber calculation for type=month which was checked in as r53893 was the number of milliseconds since UNIX epoch, and it was wrong. The correct way is the number months since UNIX epoch. * html/DateComponents.cpp: (WebCore::DateComponents::setMonthsSinceEpoch): (WebCore::DateComponents::monthsSinceEpoch): * html/DateComponents.h: Declare setMonthsSinceEpoch() and monthsSinceEpoch(). * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseToDouble): Switch to monthsSinceEpoch() for type=MONTH. (WebCore::HTMLInputElement::valueAsDate): Add code with millisecondsSinceEpoch() for MONTH because parseToDouble() changed its behavior. (WebCore::HTMLInputElement::setValueAsNumber): Use setMonthsSinceEpoch() for MONTH. git-svn-id: svn://svn.chromium.org/blink/trunk@54120 bbb929c8-8fbe-4397-9dbb-9b2b20218538
c0a3ea6d