Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: Source/WebCore/html/BaseMultipleFieldsDateAndTimeInputType.cpp

Issue 11420032: Merge 134239 - Refactoring: set read-only values on layout in DateTimeEditElement (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Source/WebCore/html/shadow/DateTimeEditElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | Source/WebCore/html/shadow/DateTimeEditElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698