blob: 103352cc23c61fc4b268e696fe75a3e9d815ac7e [file] [log] [blame]
// 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 THIRD_PARTY_BLINK_RENDERER_CORE_DOM_EVENTS_EVENT_DISPATCH_RESULT_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_EVENTS_EVENT_DISPATCH_RESULT_H_
namespace blink {
enum class DispatchEventResult {
// Event was not canceled by event handler or default event handler.
kNotCanceled,
// Event was canceled by event handler; i.e. a script handler calling
// preventDefault.
kCanceledByEventHandler,
// 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.
kCanceledByDefaultEventHandler,
// 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.
kCanceledBeforeDispatch,
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_DOM_EVENTS_EVENT_DISPATCH_RESULT_H_