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

Unified Diff: third_party/WebKit/Source/core/events/EventDispatchResult.h

Issue 1479923002: Enumerate the return value of dispatchEvent so it is clear. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_passive_uma_add
Patch Set: Fix typo Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/events/EventDispatchResult.h
diff --git a/third_party/WebKit/Source/core/events/EventDispatchResult.h b/third_party/WebKit/Source/core/events/EventDispatchResult.h
new file mode 100644
index 0000000000000000000000000000000000000000..a79e0343ccbc82eeb4f21314bbf0440693bb87af
--- /dev/null
+++ b/third_party/WebKit/Source/core/events/EventDispatchResult.h
@@ -0,0 +1,29 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EventDispatchResult_h
+#define EventDispatchResult_h
+
+namespace blink {
+
+enum class DispatchEventResult {
+ // Event was not canceled by event handler or default event handler.
+ NotCanceled,
+ // Event was canceled by event handler; i.e. a script handler calling preventDefault.
+ CanceledByEventHandler,
+ // Event was canceled by the default event handler; i.e. executing the default action.
+ // This result should be used sparingly as it deviates from the DOM Event Dispatch
+ // model. Default event handlers really shouldn't be invoked inside of dispatch.
+ CanceledByDefaultEventHandler,
+ // Event was canceled but suppressed before dispatched to event handler.
+ // This result should be used sparingly; and its usage likely indicates
+ // there is potential for a bug. Trusted events may return this code; but untrusted
+ // events likely should always execute the event handler the developer intends to
+ // execute.
+ CanceledBeforeDispatch,
+};
+
+} // namespace blink
+
+#endif // EventDispatchResult_h

Powered by Google App Engine
This is Rietveld 408576698