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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 date.setMillisecondsSinceMidnight(current); | 83 date.setMillisecondsSinceMidnight(current); |
84 double milliseconds = date.millisecondsSinceEpoch(); | 84 double milliseconds = date.millisecondsSinceEpoch(); |
85 ASSERT(std::isfinite(milliseconds)); | 85 ASSERT(std::isfinite(milliseconds)); |
86 return Decimal::fromDouble(milliseconds); | 86 return Decimal::fromDouble(milliseconds); |
87 } | 87 } |
88 | 88 |
89 StepRange TimeInputType::createStepRange(AnyStepHandling anyStepHandling) const | 89 StepRange TimeInputType::createStepRange(AnyStepHandling anyStepHandling) const |
90 { | 90 { |
91 DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (time
DefaultStep, timeDefaultStepBase, timeStepScaleFactor, StepRange::ScaledStepValu
eShouldBeInteger)); | 91 DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (time
DefaultStep, timeDefaultStepBase, timeStepScaleFactor, StepRange::ScaledStepValu
eShouldBeInteger)); |
92 | 92 |
93 return InputType::createStepRange(anyStepHandling, 0, Decimal::fromDouble(Da
teComponents::minimumTime()), Decimal::fromDouble(DateComponents::maximumTime())
, stepDescription); | 93 return InputType::createStepRange(anyStepHandling, timeDefaultStepBase, Deci
mal::fromDouble(DateComponents::minimumTime()), Decimal::fromDouble(DateComponen
ts::maximumTime()), stepDescription); |
94 } | 94 } |
95 | 95 |
96 bool TimeInputType::parseToDateComponentsInternal(const String& string, DateComp
onents* out) const | 96 bool TimeInputType::parseToDateComponentsInternal(const String& string, DateComp
onents* out) const |
97 { | 97 { |
98 ASSERT(out); | 98 ASSERT(out); |
99 unsigned end; | 99 unsigned end; |
100 return out->parseTime(string, 0, end) && end == string.length(); | 100 return out->parseTime(string, 0, end) && end == string.length(); |
101 } | 101 } |
102 | 102 |
103 bool TimeInputType::setMillisecondToDateComponents(double value, DateComponents*
date) const | 103 bool TimeInputType::setMillisecondToDateComponents(double value, DateComponents*
date) const |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 layoutParameters.maximum = DateComponents(); | 160 layoutParameters.maximum = DateComponents(); |
161 } | 161 } |
162 | 162 |
163 bool TimeInputType::isValidFormat(bool hasYear, bool hasMonth, bool hasWeek, boo
l hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) const | 163 bool TimeInputType::isValidFormat(bool hasYear, bool hasMonth, bool hasWeek, boo
l hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) const |
164 { | 164 { |
165 return hasHour && hasMinute && hasAMPM; | 165 return hasHour && hasMinute && hasAMPM; |
166 } | 166 } |
167 #endif | 167 #endif |
168 | 168 |
169 } // namespace WebCore | 169 } // namespace WebCore |
OLD | NEW |