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

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

Issue 12047073: Merge 140324 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 months 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 | « LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events-expected.txt ('k') | no next file » | 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 // We don't need to call focus(). This function is called when control 66 // We don't need to call focus(). This function is called when control
67 // got focus. 67 // got focus.
68 68
69 // Add focus ring by CSS "focus" pseudo class. 69 // Add focus ring by CSS "focus" pseudo class.
70 element()->setFocus(true); 70 element()->setFocus(true);
71 } 71 }
72 72
73 void BaseMultipleFieldsDateAndTimeInputType::editControlValueChanged() 73 void BaseMultipleFieldsDateAndTimeInputType::editControlValueChanged()
74 { 74 {
75 RefPtr<HTMLInputElement> input(element()); 75 RefPtr<HTMLInputElement> input(element());
76 input->setValueInternal(sanitizeValue(m_dateTimeEditElement->value()), Dispa tchNoEvent); 76 String oldValue = input->value();
77 input->setNeedsStyleRecalc(); 77 String newValue = sanitizeValue(m_dateTimeEditElement->value());
78 input->dispatchFormControlInputEvent(); 78 // Even if oldValue is null and newValue is "", we should assume they are sa me.
79 input->dispatchFormControlChangeEvent(); 79 if ((oldValue.isEmpty() && newValue.isEmpty()) || oldValue == newValue)
80 input->setNeedsValidityCheck();
81 else {
82 input->setValueInternal(newValue, DispatchNoEvent);
83 input->setNeedsStyleRecalc();
84 input->dispatchFormControlInputEvent();
85 input->dispatchFormControlChangeEvent();
86 }
80 input->notifyFormStateChanged(); 87 input->notifyFormStateChanged();
81 } 88 }
82 89
83 bool BaseMultipleFieldsDateAndTimeInputType::hasCustomFocusLogic() const 90 bool BaseMultipleFieldsDateAndTimeInputType::hasCustomFocusLogic() const
84 { 91 {
85 return false; 92 return false;
86 } 93 }
87 94
88 bool BaseMultipleFieldsDateAndTimeInputType::isEditControlOwnerDisabled() const 95 bool BaseMultipleFieldsDateAndTimeInputType::isEditControlOwnerDisabled() const
89 { 96 {
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 { 441 {
435 StepRange stepRange = createStepRange(AnyIsDefaultStep); 442 StepRange stepRange = createStepRange(AnyIsDefaultStep);
436 return date.second() || date.millisecond() 443 return date.second() || date.millisecond()
437 || !stepRange.minimum().remainder(static_cast<int>(msPerMinute)).isZero( ) 444 || !stepRange.minimum().remainder(static_cast<int>(msPerMinute)).isZero( )
438 || !stepRange.step().remainder(static_cast<int>(msPerMinute)).isZero(); 445 || !stepRange.step().remainder(static_cast<int>(msPerMinute)).isZero();
439 } 446 }
440 447
441 } // namespace WebCore 448 } // namespace WebCore
442 449
443 #endif 450 #endif
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698