OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef EventDispatchResult_h | 5 #ifndef EventDispatchResult_h |
6 #define EventDispatchResult_h | 6 #define EventDispatchResult_h |
7 | 7 |
8 namespace blink { | 8 namespace blink { |
9 | 9 |
10 enum class DispatchEventResult { | 10 enum class DispatchEventResult { |
11 // Event was not canceled by event handler or default event handler. | 11 // Event was not canceled by event handler or default event handler. |
12 NotCanceled, | 12 NotCanceled, |
13 // Event was canceled by event handler; i.e. a script handler calling preventD
efault. | 13 // Event was canceled by event handler; i.e. a script handler calling |
| 14 // preventDefault. |
14 CanceledByEventHandler, | 15 CanceledByEventHandler, |
15 // Event was canceled by the default event handler; i.e. executing the default
action. | 16 // Event was canceled by the default event handler; i.e. executing the default |
16 // This result should be used sparingly as it deviates from the DOM Event Disp
atch | 17 // action. This result should be used sparingly as it deviates from the DOM |
17 // model. Default event handlers really shouldn't be invoked inside of dispatc
h. | 18 // Event Dispatch model. Default event handlers really shouldn't be invoked |
| 19 // inside of dispatch. |
18 CanceledByDefaultEventHandler, | 20 CanceledByDefaultEventHandler, |
19 // Event was canceled but suppressed before dispatched to event handler. | 21 // Event was canceled but suppressed before dispatched to event handler. This |
20 // This result should be used sparingly; and its usage likely indicates | 22 // result should be used sparingly; and its usage likely indicates there is |
21 // there is potential for a bug. Trusted events may return this code; but untr
usted | 23 // potential for a bug. Trusted events may return this code; but untrusted |
22 // events likely should always execute the event handler the developer intends
to | 24 // events likely should always execute the event handler the developer intends |
23 // execute. | 25 // to execute. |
24 CanceledBeforeDispatch, | 26 CanceledBeforeDispatch, |
25 }; | 27 }; |
26 | 28 |
27 } // namespace blink | 29 } // namespace blink |
28 | 30 |
29 #endif // EventDispatchResult_h | 31 #endif // EventDispatchResult_h |
OLD | NEW |