| Index: Source/core/html/forms/MonthInputType.cpp
|
| diff --git a/Source/core/html/forms/MonthInputType.cpp b/Source/core/html/forms/MonthInputType.cpp
|
| index 3003558693df0ab5e7ef9c346b4431894d1f6fea..32a937324ca52d7050c5b39aecf124e4a1a406e4 100644
|
| --- a/Source/core/html/forms/MonthInputType.cpp
|
| +++ b/Source/core/html/forms/MonthInputType.cpp
|
| @@ -108,17 +108,17 @@ StepRange MonthInputType::createStepRange(AnyStepHandling anyStepHandling) const
|
| {
|
| DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (monthDefaultStep, monthDefaultStepBase, monthStepScaleFactor, StepRange::ParsedStepValueShouldBeInteger));
|
|
|
| - const Decimal stepBase = parseToNumber(element().fastGetAttribute(minAttr), Decimal::fromDouble(monthDefaultStepBase));
|
| - const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), Decimal::fromDouble(DateComponents::minimumMonth()));
|
| - const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), Decimal::fromDouble(DateComponents::maximumMonth()));
|
| + const Decimal stepBase = parseToNumber(element().fastGetAttribute(minAttr), element().fastGetAttribute(minAttr), Decimal::fromDouble(monthDefaultStepBase));
|
| + const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), String(), Decimal::fromDouble(DateComponents::minimumMonth()));
|
| + const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), String(), Decimal::fromDouble(DateComponents::maximumMonth()));
|
| const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription, element().fastGetAttribute(stepAttr));
|
| return StepRange(stepBase, minimum, maximum, step, stepDescription);
|
| }
|
|
|
| -Decimal MonthInputType::parseToNumber(const String& src, const Decimal& defaultValue) const
|
| +Decimal MonthInputType::parseToNumber(const String& src, const String& alternative, const Decimal& defaultValue) const
|
| {
|
| DateComponents date;
|
| - if (!parseToDateComponents(src, &date))
|
| + if (!parseToDateComponents(src, &date) && !parseToDateComponents(alternative, &date))
|
| return defaultValue;
|
| double months = date.monthsSinceEpoch();
|
| ASSERT(std::isfinite(months));
|
|
|