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

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

Issue 128133002: Update of change event for input type number (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code review changes Created 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 { 215 {
216 if (element().isDisabledOrReadOnly()) 216 if (element().isDisabledOrReadOnly())
217 return; 217 return;
218 const String& key = event->keyIdentifier(); 218 const String& key = event->keyIdentifier();
219 if (key == "Up") 219 if (key == "Up")
220 spinButtonStepUp(); 220 spinButtonStepUp();
221 else if (key == "Down") 221 else if (key == "Down")
222 spinButtonStepDown(); 222 spinButtonStepDown();
223 else 223 else
224 return; 224 return;
225 element().dispatchFormControlChangeEvent();
225 event->setDefaultHandled(); 226 event->setDefaultHandled();
226 } 227 }
227 228
228 void TextFieldInputType::forwardEvent(Event* event) 229 void TextFieldInputType::forwardEvent(Event* event)
229 { 230 {
230 if (SpinButtonElement* spinButton = spinButtonElement()) { 231 if (SpinButtonElement* spinButton = spinButtonElement()) {
231 spinButton->forwardEvent(event); 232 spinButton->forwardEvent(event);
232 if (event->defaultHandled()) 233 if (event->defaultHandled())
233 return; 234 return;
234 } 235 }
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 bool TextFieldInputType::shouldSpinButtonRespondToMouseEvents() 569 bool TextFieldInputType::shouldSpinButtonRespondToMouseEvents()
569 { 570 {
570 return !element().isDisabledOrReadOnly(); 571 return !element().isDisabledOrReadOnly();
571 } 572 }
572 573
573 bool TextFieldInputType::shouldSpinButtonRespondToWheelEvents() 574 bool TextFieldInputType::shouldSpinButtonRespondToWheelEvents()
574 { 575 {
575 return shouldSpinButtonRespondToMouseEvents() && element().focused(); 576 return shouldSpinButtonRespondToMouseEvents() && element().focused();
576 } 577 }
577 578
579 void TextFieldInputType::spinButtonDidReleaseMouseCapture()
580 {
581 element().dispatchFormControlChangeEvent();
582 }
583
578 } // namespace WebCore 584 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/forms/TextFieldInputType.h ('k') | Source/core/html/shadow/SpinButtonElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698