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

Side by Side Diff: Source/core/html/forms/BaseMultipleFieldsDateAndTimeInputType.cpp

Issue 196933006: Do not dispatch 'change' events during pressing spin buttons for input[type=number]. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Avoid extra change event Created 6 years, 9 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 if (DateTimeEditElement* edit = dateTimeEditElement()) 233 if (DateTimeEditElement* edit = dateTimeEditElement())
234 edit->stepDown(); 234 edit->stepDown();
235 } 235 }
236 236
237 void BaseMultipleFieldsDateAndTimeInputType::spinButtonStepUp() 237 void BaseMultipleFieldsDateAndTimeInputType::spinButtonStepUp()
238 { 238 {
239 if (DateTimeEditElement* edit = dateTimeEditElement()) 239 if (DateTimeEditElement* edit = dateTimeEditElement())
240 edit->stepUp(); 240 edit->stepUp();
241 } 241 }
242 242
243 void BaseMultipleFieldsDateAndTimeInputType::spinButtonDidReleaseMouseCapture()
244 {
245 if (element().focused())
tkent 2014/03/18 08:26:20 Why is this check needed? We should dispatch two
Habib Virji 2014/03/18 17:37:27 It is needed since releaseCapture is called from d
tkent 2014/03/31 07:50:39 I see. We should not dispatch any events in detac
246 element().dispatchFormControlChangeEvent();
247 }
248
243 bool BaseMultipleFieldsDateAndTimeInputType::isPickerIndicatorOwnerDisabledOrRea dOnly() const 249 bool BaseMultipleFieldsDateAndTimeInputType::isPickerIndicatorOwnerDisabledOrRea dOnly() const
244 { 250 {
245 return element().isDisabledOrReadOnly(); 251 return element().isDisabledOrReadOnly();
246 } 252 }
247 253
248 void BaseMultipleFieldsDateAndTimeInputType::pickerIndicatorChooseValue(const St ring& value) 254 void BaseMultipleFieldsDateAndTimeInputType::pickerIndicatorChooseValue(const St ring& value)
249 { 255 {
250 if (element().isValidValue(value)) { 256 if (element().isValidValue(value)) {
251 element().setValue(value, DispatchInputAndChangeEvent); 257 element().setValue(value, DispatchInputAndChangeEvent);
252 return; 258 return;
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 clearButton->setInlineStyleProperty(CSSPropertyPointerEvents, CSSValueNo ne); 603 clearButton->setInlineStyleProperty(CSSPropertyPointerEvents, CSSValueNo ne);
598 } else { 604 } else {
599 clearButton->removeInlineStyleProperty(CSSPropertyOpacity); 605 clearButton->removeInlineStyleProperty(CSSPropertyOpacity);
600 clearButton->removeInlineStyleProperty(CSSPropertyPointerEvents); 606 clearButton->removeInlineStyleProperty(CSSPropertyPointerEvents);
601 } 607 }
602 } 608 }
603 609
604 } // namespace WebCore 610 } // namespace WebCore
605 611
606 #endif 612 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698