triggerDocumentMouseEvent function
Dispatches a MouseEvent of type event
to the specified target
.
Verifies that the target
element is not a detached node.
Implementation
void triggerDocumentMouseEvent(Element target, String event) {
if (!document.documentElement!.contains(target)) {
throw ArgumentError.value(target, 'target', 'Target should be attached to the document.');
}
target.dispatchEvent(MouseEvent(event));
}