Dispatch event through DOM event interface
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <[email protected]> |
The nsIDOMEventTarget and nsIDOMEvent interfaces allow one to dispatch synthetic event to certain element at target. This is working fine for triggering event handlers. However, I find these simulated events don't change focus, selection ect. For example, if I simulate a click on a text node at certain screen location, the onclick handler will fire on the parent of this text node, but the caret won't move there. Similarly, a simulated click on a button won't switch the focus to the button. Is there a way to achieve those? Thanks.