EventHandlerSource Class
An event handler content attribute to compile (https://html.spec.whatwg.org/multipage/webappapis.html#getting-the-current-value-of-the-event-handler): the body of a function whose parameters are EventHandlerSource.Parameters, whose scope chain is the global environment of the realm of EventHandlerSource.Window, then EventHandlerSource.Document, EventHandlerSource.Form and EventHandlerSource.Element (when they are not null), and whose this value is the current target of the event.
public sealed class EventHandlerSourceProperties
| Name | Description |
|---|---|
| Body | Gets the body of the function: the value of the content attribute. |
| Document | Gets the document added to the scope chain (the node document of EventHandlerSource.Element), or null when EventHandlerSource.Target is a window. |
| Element | Gets the element added to the scope chain (the element of the content attribute), or null when EventHandlerSource.Target is a window. |
| Form | Gets the form owner of EventHandlerSource.Element added to the scope chain, or null. |
| Name | Gets the name of the content attribute and of the function (e.g. onclick). |
| Parameters | Gets the parameters of the function: event, or event, source, lineno, colno and error for the onerror event handler of a window (an OnErrorEventHandler). |
| Target | Gets the target of the event handler: the element, or the window for the Window-reflecting body element event handlers (e.g. <body onload>). |
| Url | Gets the URL of the document of the content attribute, used as the file name of the errors. |
| Window | Gets the global object of the realm in which the function is created. |
Document
EventHandlerSource.csGets the document added to the scope chain (the node document of EventHandlerSource.Element), or null when EventHandlerSource.Target is a window.
public Document? Document { get; }Property value
Element
EventHandlerSource.csGets the element added to the scope chain (the element of the content attribute), or null when EventHandlerSource.Target is a window.
public Element? Element { get; }Property value
Gets the form owner of EventHandlerSource.Element added to the scope chain, or null.
public HtmlFormElement? Form { get; }Property value
Parameters
EventHandlerSource.csGets the parameters of the function: event, or event, source, lineno, colno and error for the onerror event handler of a window (an OnErrorEventHandler).
public IReadOnlyList<string> Parameters { get; }Property value
Target
EventHandlerSource.csGets the target of the event handler: the element, or the window for the Window-reflecting body element event handlers (e.g. <body onload>).
public EventTarget Target { get; }