OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 void DateTimeLocalInputType::setValueAsDate(double value, ExceptionState& except
ionState) const | 79 void DateTimeLocalInputType::setValueAsDate(double value, ExceptionState& except
ionState) const |
80 { | 80 { |
81 // valueAsDate doesn't work for the datetime-local type according to the sta
ndard. | 81 // valueAsDate doesn't work for the datetime-local type according to the sta
ndard. |
82 InputType::setValueAsDate(value, exceptionState); | 82 InputType::setValueAsDate(value, exceptionState); |
83 } | 83 } |
84 | 84 |
85 StepRange DateTimeLocalInputType::createStepRange(AnyStepHandling anyStepHandlin
g) const | 85 StepRange DateTimeLocalInputType::createStepRange(AnyStepHandling anyStepHandlin
g) const |
86 { | 86 { |
87 DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (date
TimeLocalDefaultStep, dateTimeLocalDefaultStepBase, dateTimeLocalStepScaleFactor
, StepRange::ScaledStepValueShouldBeInteger)); | 87 DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (date
TimeLocalDefaultStep, dateTimeLocalDefaultStepBase, dateTimeLocalStepScaleFactor
, StepRange::ScaledStepValueShouldBeInteger)); |
88 | 88 |
89 const Decimal stepBase = parseToNumber(element().fastGetAttribute(minAttr),
0); | 89 const Decimal stepBase = parseToNumber(element().fastGetAttribute(minAttr),
element().fastGetAttribute(valueAttr), 0); |
90 const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), D
ecimal::fromDouble(DateComponents::minimumDateTime())); | 90 const Decimal minimum = parseToNumber(element().fastGetAttribute(minAttr), S
tring(), Decimal::fromDouble(DateComponents::minimumDateTime())); |
91 const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), D
ecimal::fromDouble(DateComponents::maximumDateTime())); | 91 const Decimal maximum = parseToNumber(element().fastGetAttribute(maxAttr), S
tring(), Decimal::fromDouble(DateComponents::maximumDateTime())); |
92 const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription,
element().fastGetAttribute(stepAttr)); | 92 const Decimal step = StepRange::parseStep(anyStepHandling, stepDescription,
element().fastGetAttribute(stepAttr)); |
93 return StepRange(stepBase, minimum, maximum, step, stepDescription); | 93 return StepRange(stepBase, minimum, maximum, step, stepDescription); |
94 } | 94 } |
95 | 95 |
96 bool DateTimeLocalInputType::parseToDateComponentsInternal(const String& string,
DateComponents* out) const | 96 bool DateTimeLocalInputType::parseToDateComponentsInternal(const String& string,
DateComponents* out) const |
97 { | 97 { |
98 ASSERT(out); | 98 ASSERT(out); |
99 unsigned end; | 99 unsigned end; |
100 return out->parseDateTimeLocal(string, 0, end) && end == string.length(); | 100 return out->parseDateTimeLocal(string, 0, end) && end == string.length(); |
101 } | 101 } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 layoutParameters.placeholderForYear = locale().queryString(WebLocalizedStrin
g::PlaceholderForYearField); | 167 layoutParameters.placeholderForYear = locale().queryString(WebLocalizedStrin
g::PlaceholderForYearField); |
168 } | 168 } |
169 | 169 |
170 bool DateTimeLocalInputType::isValidFormat(bool hasYear, bool hasMonth, bool has
Week, bool hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) c
onst | 170 bool DateTimeLocalInputType::isValidFormat(bool hasYear, bool hasMonth, bool has
Week, bool hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) c
onst |
171 { | 171 { |
172 return hasYear && hasMonth && hasDay && hasAMPM && hasHour && hasMinute; | 172 return hasYear && hasMonth && hasDay && hasAMPM && hasHour && hasMinute; |
173 } | 173 } |
174 #endif | 174 #endif |
175 | 175 |
176 } // namespace WebCore | 176 } // namespace WebCore |
OLD | NEW |