EventHandlerCallback Class

The value of an event handler (https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers) that is a callback of a script engine: an EventHandler, OnErrorEventHandler or OnBeforeUnloadEventHandler callback function. The library invokes it with the event handler processing algorithm and processes its return value (e.g. return false cancels the event).

public abstract class EventHandlerCallback

Constructors

NameDescription
EventHandlerCallback()

EventHandlerCallback()

protected EventHandlerCallback()

No documentation is available.

Methods

NameDescription
Invoke(EventTarget, object?[])Invokes the callback (https://webidl.spec.whatwg.org/#invoke-a-callback-function) with thisValue as the this value. An exception thrown by the callback is reported by the engine to the global object of the realm of the callback, and the callback returns null.

Invoke(EventTarget, object?[])

Invokes the callback (https://webidl.spec.whatwg.org/#invoke-a-callback-function) with thisValue as the this value. An exception thrown by the callback is reported by the engine to the global object of the realm of the callback, and the callback returns null.

protected internal abstract object? Invoke(EventTarget thisValue, object?[] arguments)

Parameters

thisValue EventTarget
The current target of the event.
arguments object?[]
The event, or, for the special error event handling of the onerror handler of a window, the message, the file name, the line number, the column number and the error of the ErrorEvent.

Returns

object? The return value: a Boolean when the callback returns a JavaScript boolean, null when it returns undefined or null, a String when the callback is an OnBeforeUnloadEventHandler (the result is converted to a DOMString?), or any other value.