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

Side by Side Diff: third_party/WebKit/Source/core/html/forms/MultipleFieldsTemporalInputTypeView.cpp

Issue 2796853002: Update text field 'change' event logic to match to Firefox. (Closed)
Patch Set: . Created 3 years, 8 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
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 190 }
191 191
192 void MultipleFieldsTemporalInputTypeView::editControlValueChanged() { 192 void MultipleFieldsTemporalInputTypeView::editControlValueChanged() {
193 String oldValue = element().value(); 193 String oldValue = element().value();
194 String newValue = m_inputType->sanitizeValue(dateTimeEditElement()->value()); 194 String newValue = m_inputType->sanitizeValue(dateTimeEditElement()->value());
195 // Even if oldValue is null and newValue is "", we should assume they are 195 // Even if oldValue is null and newValue is "", we should assume they are
196 // same. 196 // same.
197 if ((oldValue.isEmpty() && newValue.isEmpty()) || oldValue == newValue) { 197 if ((oldValue.isEmpty() && newValue.isEmpty()) || oldValue == newValue) {
198 element().setNeedsValidityCheck(); 198 element().setNeedsValidityCheck();
199 } else { 199 } else {
200 element().setNonAttributeValue(newValue); 200 element().setNonAttributeValueByUserEdit(newValue);
201 element().setNeedsStyleRecalc( 201 element().setNeedsStyleRecalc(
202 SubtreeStyleChange, 202 SubtreeStyleChange,
203 StyleChangeReasonForTracing::create(StyleChangeReason::ControlValue)); 203 StyleChangeReasonForTracing::create(StyleChangeReason::ControlValue));
204 element().dispatchFormControlInputEvent(); 204 element().dispatchFormControlInputEvent();
205 } 205 }
206 element().notifyFormStateChanged(); 206 element().notifyFormStateChanged();
207 element().updateClearButtonVisibility(); 207 element().updateClearButtonVisibility();
208 } 208 }
209 209
210 String MultipleFieldsTemporalInputTypeView::formatDateTimeFieldsState( 210 String MultipleFieldsTemporalInputTypeView::formatDateTimeFieldsState(
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 return element().locale().isRTL() ? TextDirection::kRtl : TextDirection::kLtr; 627 return element().locale().isRTL() ? TextDirection::kRtl : TextDirection::kLtr;
628 } 628 }
629 629
630 AXObject* MultipleFieldsTemporalInputTypeView::popupRootAXObject() { 630 AXObject* MultipleFieldsTemporalInputTypeView::popupRootAXObject() {
631 if (PickerIndicatorElement* picker = pickerIndicatorElement()) 631 if (PickerIndicatorElement* picker = pickerIndicatorElement())
632 return picker->popupRootAXObject(); 632 return picker->popupRootAXObject();
633 return nullptr; 633 return nullptr;
634 } 634 }
635 635
636 } // namespace blink 636 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698