| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 275 |
| 276 bool BaseMultipleFieldsDateAndTimeInputType::isTextField() const | 276 bool BaseMultipleFieldsDateAndTimeInputType::isTextField() const |
| 277 { | 277 { |
| 278 return false; | 278 return false; |
| 279 } | 279 } |
| 280 | 280 |
| 281 void BaseMultipleFieldsDateAndTimeInputType::restoreFormControlState(const FormC
ontrolState& state) | 281 void BaseMultipleFieldsDateAndTimeInputType::restoreFormControlState(const FormC
ontrolState& state) |
| 282 { | 282 { |
| 283 if (!m_dateTimeEditElement) | 283 if (!m_dateTimeEditElement) |
| 284 return; | 284 return; |
| 285 DateComponents date; | |
| 286 setMillisecondToDateComponents(createStepRange(AnyIsDefaultStep).minimum().t
oDouble(), &date); | |
| 287 DateTimeFieldsState dateTimeFieldsState = DateTimeFieldsState::restoreFormCo
ntrolState(state); | 285 DateTimeFieldsState dateTimeFieldsState = DateTimeFieldsState::restoreFormCo
ntrolState(state); |
| 288 m_dateTimeEditElement->setValueAsDateTimeFieldsState(dateTimeFieldsState, da
te); | 286 m_dateTimeEditElement->setValueAsDateTimeFieldsState(dateTimeFieldsState); |
| 289 element()->setValueInternal(sanitizeValue(m_dateTimeEditElement->value()), D
ispatchNoEvent); | 287 element()->setValueInternal(sanitizeValue(m_dateTimeEditElement->value()), D
ispatchNoEvent); |
| 290 } | 288 } |
| 291 | 289 |
| 292 FormControlState BaseMultipleFieldsDateAndTimeInputType::saveFormControlState()
const | 290 FormControlState BaseMultipleFieldsDateAndTimeInputType::saveFormControlState()
const |
| 293 { | 291 { |
| 294 if (!m_dateTimeEditElement) | 292 if (!m_dateTimeEditElement) |
| 295 return FormControlState(); | 293 return FormControlState(); |
| 296 | 294 |
| 297 return m_dateTimeEditElement->valueAsDateTimeFieldsState().saveFormControlSt
ate(); | 295 return m_dateTimeEditElement->valueAsDateTimeFieldsState().saveFormControlSt
ate(); |
| 298 } | 296 } |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 { | 397 { |
| 400 StepRange stepRange = createStepRange(AnyIsDefaultStep); | 398 StepRange stepRange = createStepRange(AnyIsDefaultStep); |
| 401 return date.second() | 399 return date.second() |
| 402 || !stepRange.minimum().remainder(static_cast<int>(msPerMinute)).isZero(
) | 400 || !stepRange.minimum().remainder(static_cast<int>(msPerMinute)).isZero(
) |
| 403 || !stepRange.step().remainder(static_cast<int>(msPerMinute)).isZero(); | 401 || !stepRange.step().remainder(static_cast<int>(msPerMinute)).isZero(); |
| 404 } | 402 } |
| 405 | 403 |
| 406 } // namespace WebCore | 404 } // namespace WebCore |
| 407 | 405 |
| 408 #endif | 406 #endif |
| OLD | NEW |