Bug 1276533: Update test actor to scroll element into view before simulating mouse click;r=ochameau

MozReview-Commit-ID: ElTy62z8tl6

--HG--
extra : amend_source : c4c776f53a17cb56580fdb13caa1765d494572a4
This commit is contained in:
Steve Melia 2016-05-31 22:03:58 +01:00
parent 6ee8fdf88d
commit cd0c692386

View File

@ -326,9 +326,10 @@ var TestActor = exports.TestActor = protocol.ActorClass({
}),
/**
* Synthesize a mouse event on an element. This handler doesn't send a message
* back. Consumers should listen to specific events on the inspector/highlighter
* to know when the event got synthesized.
* Synthesize a mouse event on an element, after ensuring that it is visible
* in the viewport. This handler doesn't send a message back. Consumers
* should listen to specific events on the inspector/highlighter to know when
* the event got synthesized.
* @param {String} selector The node selector to get the node target for the event
* @param {Number} x
* @param {Number} y
@ -338,7 +339,7 @@ var TestActor = exports.TestActor = protocol.ActorClass({
*/
synthesizeMouse: protocol.method(function ({ selector, x, y, center, options }) {
let node = this._querySelector(selector);
node.scrollIntoView();
if (center) {
EventUtils.synthesizeMouseAtCenter(node, options, node.ownerDocument.defaultView);
} else {