Commit 95a3bcac 95a3bcacfc493befa32a04c8a0d2b06d084c1bd4 by Nicolas Perriault

updated CHANGELOG - refs #211 #222

1 parent d11b1e20
......@@ -11,6 +11,7 @@ XXXX-XX-XX, v1.0.0
- fixed [#204](https://github.com/n1k0/casperjs/pull/204) Fix for when the url is changed via javascript
- fixed [#236](https://github.com/n1k0/casperjs/issues/236) - Casper.exit return `this` after calling `phantom.exit()` that may caused PhantomJS to hang
- fixed [#231](https://github.com/n1k0/casperjs/pull/231) - added `--pre` and `--post` options to the `casperjs test` command to load test files before and after the execution of testsuite
- fixed [#222](https://github.com/n1k0/casperjs/pull/222) & [#211](https://github.com/n1k0/casperjs/issues/211) - Change mouse event to include an X + Y value for click position
- added [`ClientUtils.getDocumentHeight()`](http://casperjs.org/api.html#clientutils.getDocumentHeight)
- added a `--no-colors` option to the `casper test` command to skip output coloration
......
......@@ -423,18 +423,13 @@
}
try {
var evt = document.createEvent("MouseEvents");
var center_x = 1, center_y = 1;
try {
var pos = elem.getBoundingClientRect(),
var pos = elem.getBoundingClientRect();
center_x = Math.floor((pos.left + pos.right) / 2),
center_y = Math.floor((pos.top + pos.bottom) / 2);
} catch(e) {
var center_x = 1, center_y = 1;
}
} catch(e) {}
evt.initMouseEvent(type, true, true, window, 1, 1, 1, center_x, center_y, false, false, false, false, 0, elem);
// dispatchEvent return value is false if at least one of the event
// handlers which handled this event called preventDefault;
// so we cannot returns this results as it cannot accurately informs on the status
......