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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 const AtomicString& DateInputType::formControlType() const | 66 const AtomicString& DateInputType::formControlType() const |
67 { | 67 { |
68 return InputTypeNames::date; | 68 return InputTypeNames::date; |
69 } | 69 } |
70 | 70 |
71 StepRange DateInputType::createStepRange(AnyStepHandling anyStepHandling) const | 71 StepRange DateInputType::createStepRange(AnyStepHandling anyStepHandling) const |
72 { | 72 { |
73 DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (date
DefaultStep, dateDefaultStepBase, dateStepScaleFactor, StepRange::ParsedStepValu
eShouldBeInteger)); | 73 DEFINE_STATIC_LOCAL(const StepRange::StepDescription, stepDescription, (date
DefaultStep, dateDefaultStepBase, dateStepScaleFactor, StepRange::ParsedStepValu
eShouldBeInteger)); |
74 | 74 |
75 return InputType::createStepRange(anyStepHandling, 0, Decimal::fromDouble(Da
teComponents::minimumDate()), Decimal::fromDouble(DateComponents::maximumDate())
, stepDescription); | 75 return InputType::createStepRange(anyStepHandling, dateDefaultStepBase, Deci
mal::fromDouble(DateComponents::minimumDate()), Decimal::fromDouble(DateComponen
ts::maximumDate()), stepDescription); |
76 } | 76 } |
77 | 77 |
78 bool DateInputType::parseToDateComponentsInternal(const String& string, DateComp
onents* out) const | 78 bool DateInputType::parseToDateComponentsInternal(const String& string, DateComp
onents* out) const |
79 { | 79 { |
80 ASSERT(out); | 80 ASSERT(out); |
81 unsigned end; | 81 unsigned end; |
82 return out->parseDate(string, 0, end) && end == string.length(); | 82 return out->parseDate(string, 0, end) && end == string.length(); |
83 } | 83 } |
84 | 84 |
85 bool DateInputType::setMillisecondToDateComponents(double value, DateComponents*
date) const | 85 bool DateInputType::setMillisecondToDateComponents(double value, DateComponents*
date) const |
(...skipping 29 matching lines...) Expand all Loading... |
115 layoutParameters.placeholderForYear = locale().queryString(WebLocalizedStrin
g::PlaceholderForYearField); | 115 layoutParameters.placeholderForYear = locale().queryString(WebLocalizedStrin
g::PlaceholderForYearField); |
116 } | 116 } |
117 | 117 |
118 bool DateInputType::isValidFormat(bool hasYear, bool hasMonth, bool hasWeek, boo
l hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) const | 118 bool DateInputType::isValidFormat(bool hasYear, bool hasMonth, bool hasWeek, boo
l hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) const |
119 { | 119 { |
120 return hasYear && hasMonth && hasDay; | 120 return hasYear && hasMonth && hasDay; |
121 } | 121 } |
122 #endif | 122 #endif |
123 | 123 |
124 } // namespace WebCore | 124 } // namespace WebCore |
OLD | NEW |