Fired when an HTML5 DOM Event occurs. This is generic event handler that provides fast event handling for various events.
The name of the event.
The internal CSS3 selector of the event.
This is window or document for events set by Events property or the actual CSS3 selector for events set with AddEventListener and AddEventListenerEx.
The CSS3 selector of the target HTML5 Element that dispatched the event.
A back-slash separated path of Tag Name [ CSS3 Selector ] patterns, starting from the <BODY> element up to the target HTML5 Element that dispatched the event.
String |
Copy Code |
---|---|
BODY[body]/DIV[div.section]/P[p:nth-child(3)]/SPAN[p:nth-of-type(1) > span:nth-child(2)] |
The event data in JSON Stringified format:
JSON |
Copy Code |
---|---|
{ "eventName": "DOMFocusIn", "eventType": "[object FocusEvent]", "bubbles": true, "cancelBubble": false, "cancelable": false, "composed": true, "currentTarget": "", "defaultPrevented": false, "detail": 0, "eventPhase": 1, "fromElement": "", "isTrusted": true, "originalTarget": "", "path": "body", "relatedTarget": "", "returnValue": true, "srcElement": "body", "sourceCapabilities": null, "target": "body", "timeStamp": 899.6000000006461, "toElement": "", "type": "DOMFocusIn", "view": "[object Window]", "which": 0, "NONE": 0, "CAPTURING_PHASE": 1, "AT_TARGET": 2, "BUBBLING_PHASE": 3 } |
Indicates if this is a synchronous or asynchronous event.
For synchronous events only, you can set this argument to True to cancel the event and prevent its default behavior.
For synchronous events only, you can set this argument to True to cancel the event bubbling.
Fired when an HTML5 DOM Event occurs. This is generic event handler that provides fast event handling for various events.
Visual Basic |
---|
Public Event OnEvent( _ ByVal EventType As String, _ ByVal EventSelector As String, _ ByVal TargetSelector As String, _ ByVal TargetPath As String, _ ByVal EventData As String, _ ByVal Async As Boolean, _ ByRef PreventDefault As Boolean, _ ByRef CancelBubble As Boolean _ ) |
The name of the event.
The internal CSS3 selector of the event.
This is window or document for events set by Events property or the actual CSS3 selector for events set with AddEventListener and AddEventListenerEx.
The CSS3 selector of the target HTML5 Element that dispatched the event.
A back-slash separated path of Tag Name [ CSS3 Selector ] patterns, starting from the <BODY> element up to the target HTML5 Element that dispatched the event.
String |
Copy Code |
---|---|
BODY[body]/DIV[div.section]/P[p:nth-child(3)]/SPAN[p:nth-of-type(1) > span:nth-child(2)] |
The event data in JSON Stringified format:
JSON |
Copy Code |
---|---|
{ "eventName": "DOMFocusIn", "eventType": "[object FocusEvent]", "bubbles": true, "cancelBubble": false, "cancelable": false, "composed": true, "currentTarget": "", "defaultPrevented": false, "detail": 0, "eventPhase": 1, "fromElement": "", "isTrusted": true, "originalTarget": "", "path": "body", "relatedTarget": "", "returnValue": true, "srcElement": "body", "sourceCapabilities": null, "target": "body", "timeStamp": 899.6000000006461, "toElement": "", "type": "DOMFocusIn", "view": "[object Window]", "which": 0, "NONE": 0, "CAPTURING_PHASE": 1, "AT_TARGET": 2, "BUBBLING_PHASE": 3 } |
Indicates if this is a synchronous or asynchronous event.
For synchronous events only, you can set this argument to True to cancel the event and prevent its default behavior.
For synchronous events only, you can set this argument to True to cancel the event bubbling.
Setting OnEvent
There are two ways to enable receiving HTML5 DOM events through OnEvent:
Asynchronous DOM to COM Events
HTML5 DOM Events are generated by WebKit Blink Engine and are copied into an immutable format before they are transmitted from CEFXClient process to WebKitX ActiveX. Once WebKitX ActiveX receives an event notification through IPC, it fires a COM Event with the copied data of HTML DOM event. Thus, CEFXClient process does not block waiting for your client code to handle the event. WebKitX DOM Events are Immutable, meaning that you can only read event data but you cannot cancel events, stop them from bubbling or prevent default behavior.
Synchronous DOM to COM Events
WebKitX as of version 1.5.11.2591 supports synchronous DOM to COM events by implementing CefMessageRouter circuit. Events generated from WebKit Blink Engine are serialized and passed from Rendering to Browser process, which transmits them to the ActiveX. The browser process waits for the ActiveX to handle the event, where you can also cancel event bubble or prevent event's default behavior.
Please note that blocking Inter-process Communication (IPC) between 3 processes is not advisable for casual event handling and you should do so only if you need to cancel specific events. Synchronous DOM to COM Events are thread-safe and care has been placed in order to support this feature seamlessly in single-threaded Applications without deadlocks. For that purpose, synchronous events are serialized using mutex synchronization on entry, meaning that synchronous events occupy the IPC channel one at a time. Please contact us for more implementation details or if you need a different handling of DOM to COM events.