OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 int DateTimeNumericFieldElement::maximum() const | 153 int DateTimeNumericFieldElement::maximum() const |
154 { | 154 { |
155 return m_range.maximum; | 155 return m_range.maximum; |
156 } | 156 } |
157 | 157 |
158 int DateTimeNumericFieldElement::minimum() const | 158 int DateTimeNumericFieldElement::minimum() const |
159 { | 159 { |
160 return m_range.minimum; | 160 return m_range.minimum; |
161 } | 161 } |
162 | 162 |
163 void DateTimeNumericFieldElement::setEmptyValue(const DateComponents& dateForRea
dOnlyField, EventBehavior eventBehavior) | 163 void DateTimeNumericFieldElement::setEmptyValue(EventBehavior eventBehavior) |
164 { | 164 { |
165 m_lastDigitCharTime = 0; | 165 m_lastDigitCharTime = 0; |
166 | 166 |
167 if (isReadOnly()) { | 167 if (isReadOnly()) |
168 setValueAsDate(dateForReadOnlyField); | |
169 return; | 168 return; |
170 } | |
171 | 169 |
172 m_hasValue = false; | 170 m_hasValue = false; |
173 m_value = 0; | 171 m_value = 0; |
174 updateVisibleValue(eventBehavior); | 172 updateVisibleValue(eventBehavior); |
175 } | 173 } |
176 | 174 |
177 void DateTimeNumericFieldElement::setValueAsInteger(int value, EventBehavior eve
ntBehavior) | 175 void DateTimeNumericFieldElement::setValueAsInteger(int value, EventBehavior eve
ntBehavior) |
178 { | 176 { |
179 m_value = clampValueForHardLimits(value); | 177 m_value = clampValueForHardLimits(value); |
180 m_hasValue = true; | 178 m_hasValue = true; |
(...skipping 28 matching lines...) Expand all Loading... |
209 } | 207 } |
210 | 208 |
211 String DateTimeNumericFieldElement::visibleValue() const | 209 String DateTimeNumericFieldElement::visibleValue() const |
212 { | 210 { |
213 return m_hasValue ? value() : m_placeholder; | 211 return m_hasValue ? value() : m_placeholder; |
214 } | 212 } |
215 | 213 |
216 } // namespace WebCore | 214 } // namespace WebCore |
217 | 215 |
218 #endif | 216 #endif |
OLD | NEW |