mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Fixing mochitest to round, not truncate, coords when trying to dispatch mouse events relative to nodes which are positioned at fractional pixels. Reenabling the test that was failing because of the truncation
This commit is contained in:
parent
2b8cf3c2d4
commit
30a5c2b827
@ -78,8 +78,8 @@ addLoadEvent(function() {
|
||||
submitForm(++pendingLoads);
|
||||
submitForm(++pendingLoads);
|
||||
submitForm(++pendingLoads);
|
||||
/* submitFormMouse(++pendingLoads);
|
||||
submitFormMouse(++pendingLoads);*/
|
||||
submitFormMouse(++pendingLoads);
|
||||
submitFormMouse(++pendingLoads);
|
||||
}, 0);
|
||||
});
|
||||
|
||||
|
@ -211,15 +211,18 @@ function synthesizeMouse(aTarget, aOffsetX, aOffsetY, aEvent, aWindow)
|
||||
var modifiers = _parseModifiers(aEvent);
|
||||
|
||||
var rect = aTarget.getBoundingClientRect();
|
||||
var left = rect.left;
|
||||
var top = rect.top;
|
||||
|
||||
// Need to round, since rect could have non-integer coordinates, and sadly
|
||||
// our event code can't deal with fractional pixel click coords.
|
||||
var left = Math.round(rect.left + aOffsetX);
|
||||
var top = Math.round(rect.top + aOffsetY);
|
||||
|
||||
if (aEvent.type) {
|
||||
utils.sendMouseEvent(aEvent.type, left + aOffsetX, top + aOffsetY, button, clickCount, modifiers);
|
||||
utils.sendMouseEvent(aEvent.type, left, top, button, clickCount, modifiers);
|
||||
}
|
||||
else {
|
||||
utils.sendMouseEvent("mousedown", left + aOffsetX, top + aOffsetY, button, clickCount, modifiers);
|
||||
utils.sendMouseEvent("mouseup", left + aOffsetX, top + aOffsetY, button, clickCount, modifiers);
|
||||
utils.sendMouseEvent("mousedown", left, top, button, clickCount, modifiers);
|
||||
utils.sendMouseEvent("mouseup", left, top, button, clickCount, modifiers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user