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

Side by Side Diff: Source/core/html/shadow/DateTimeFieldElement.cpp

Issue 228633003: Do not dispatch change event when pressing spin button for input type=datetime (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Detach handling for DateTime field Created 6 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
« no previous file with comments | « Source/core/html/shadow/DateTimeFieldElement.h ('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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 , m_fieldOwner(&fieldOwner) 51 , m_fieldOwner(&fieldOwner)
52 { 52 {
53 } 53 }
54 54
55 void DateTimeFieldElement::defaultEventHandler(Event* event) 55 void DateTimeFieldElement::defaultEventHandler(Event* event)
56 { 56 {
57 if (event->isKeyboardEvent()) { 57 if (event->isKeyboardEvent()) {
58 KeyboardEvent* keyboardEvent = toKeyboardEvent(event); 58 KeyboardEvent* keyboardEvent = toKeyboardEvent(event);
59 if (!isDisabled() && !isFieldOwnerDisabled() && !isFieldOwnerReadOnly()) { 59 if (!isDisabled() && !isFieldOwnerDisabled() && !isFieldOwnerReadOnly()) {
60 handleKeyboardEvent(keyboardEvent); 60 handleKeyboardEvent(keyboardEvent);
61 if (keyboardEvent->defaultHandled()) 61 if (keyboardEvent->defaultHandled()) {
62 if (m_fieldOwner)
63 m_fieldOwner->fieldDidChangeValueByKeyboard();
62 return; 64 return;
65 }
63 } 66 }
64 defaultKeyboardEventHandler(keyboardEvent); 67 defaultKeyboardEventHandler(keyboardEvent);
68 if (m_fieldOwner)
69 m_fieldOwner->fieldDidChangeValueByKeyboard();
65 if (keyboardEvent->defaultHandled()) 70 if (keyboardEvent->defaultHandled())
66 return; 71 return;
67 } 72 }
68 73
69 HTMLElement::defaultEventHandler(event); 74 HTMLElement::defaultEventHandler(event);
70 } 75 }
71 76
72 void DateTimeFieldElement::defaultKeyboardEventHandler(KeyboardEvent* keyboardEv ent) 77 void DateTimeFieldElement::defaultKeyboardEventHandler(KeyboardEvent* keyboardEv ent)
73 { 78 {
74 if (keyboardEvent->type() != EventTypeNames::keydown) 79 if (keyboardEvent->type() != EventTypeNames::keydown)
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 } 226 }
222 227
223 int DateTimeFieldElement::valueForARIAValueNow() const 228 int DateTimeFieldElement::valueForARIAValueNow() const
224 { 229 {
225 return valueAsInteger(); 230 return valueAsInteger();
226 } 231 }
227 232
228 } // namespace WebCore 233 } // namespace WebCore
229 234
230 #endif 235 #endif
OLDNEW
« no previous file with comments | « Source/core/html/shadow/DateTimeFieldElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698