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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void DateTimeLocalInputType::setValueAsDate(double value, ExceptionState& except
ionState) const | 74 void DateTimeLocalInputType::setValueAsDate(double value, ExceptionState& except
ionState) const |
75 { | 75 { |
76 // valueAsDate doesn't work for the datetime-local type according to the sta
ndard. | 76 // valueAsDate doesn't work for the datetime-local type according to the sta
ndard. |
77 InputType::setValueAsDate(value, exceptionState); | 77 InputType::setValueAsDate(value, exceptionState); |
78 } | 78 } |
79 | 79 |
80 StepRange DateTimeLocalInputType::createStepRange(AnyStepHandling anyStepHandlin
g) const | 80 StepRange DateTimeLocalInputType::createStepRange(AnyStepHandling anyStepHandlin
g) const |
81 { | 81 { |
82 DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (date
TimeLocalDefaultStep, dateTimeLocalDefaultStepBase, dateTimeLocalStepScaleFactor
, StepRange::ScaledStepValueShouldBeInteger)); | 82 DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (date
TimeLocalDefaultStep, dateTimeLocalDefaultStepBase, dateTimeLocalStepScaleFactor
, StepRange::ScaledStepValueShouldBeInteger)); |
83 | 83 |
84 return InputType::createStepRange(anyStepHandling, 0, Decimal::fromDouble(Da
teComponents::minimumDateTime()), Decimal::fromDouble(DateComponents::maximumDat
eTime()), stepDescription); | 84 return InputType::createStepRange(anyStepHandling, dateTimeLocalDefaultStepB
ase, Decimal::fromDouble(DateComponents::minimumDateTime()), Decimal::fromDouble
(DateComponents::maximumDateTime()), stepDescription); |
85 } | 85 } |
86 | 86 |
87 bool DateTimeLocalInputType::parseToDateComponentsInternal(const String& string,
DateComponents* out) const | 87 bool DateTimeLocalInputType::parseToDateComponentsInternal(const String& string,
DateComponents* out) const |
88 { | 88 { |
89 ASSERT(out); | 89 ASSERT(out); |
90 unsigned end; | 90 unsigned end; |
91 return out->parseDateTimeLocal(string, 0, end) && end == string.length(); | 91 return out->parseDateTimeLocal(string, 0, end) && end == string.length(); |
92 } | 92 } |
93 | 93 |
94 bool DateTimeLocalInputType::setMillisecondToDateComponents(double value, DateCo
mponents* date) const | 94 bool DateTimeLocalInputType::setMillisecondToDateComponents(double value, DateCo
mponents* date) const |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 layoutParameters.placeholderForYear = locale().queryString(WebLocalizedStrin
g::PlaceholderForYearField); | 158 layoutParameters.placeholderForYear = locale().queryString(WebLocalizedStrin
g::PlaceholderForYearField); |
159 } | 159 } |
160 | 160 |
161 bool DateTimeLocalInputType::isValidFormat(bool hasYear, bool hasMonth, bool has
Week, bool hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) c
onst | 161 bool DateTimeLocalInputType::isValidFormat(bool hasYear, bool hasMonth, bool has
Week, bool hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) c
onst |
162 { | 162 { |
163 return hasYear && hasMonth && hasDay && hasAMPM && hasHour && hasMinute; | 163 return hasYear && hasMonth && hasDay && hasAMPM && hasHour && hasMinute; |
164 } | 164 } |
165 #endif | 165 #endif |
166 | 166 |
167 } // namespace WebCore | 167 } // namespace WebCore |
OLD | NEW |