OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |