Bug 544537. Send a click to each image to force it to setup its image map.

This commit is contained in:
Timothy Nikkel 2010-05-01 13:42:47 -05:00
Родитель 09fd4b3911
Коммит d49d56b78e
1 изменённых файлов: 6 добавлений и 23 удалений

Просмотреть файл

@ -57,33 +57,16 @@ SimpleTest.waitForExplicitFinish();
function runTests()
{
//XXX We need to make sure a paint has happened on the images because that is
// when the image maps actually get setup.
// There's no way to force painting to happen on OS X, maybe some synthesized
// mouse events will do the job?
//XXX We send a useless click to each image to force it to setup its image
// map, because flushing layout won't do it.
synthesizeMouse($("image"), 5, 5, { type: "mousedown" });
synthesizeMouse($("otherelement"), 5, 5, { type: "mousemove" });
synthesizeMouse($("image"), 5, 5, { type: "mouseup" });
synthesizeMouse($("img1"), 5, 5, { type: "mousedown" });
synthesizeMouse($("img1"), 5, 5, { type: "mouseup" });
synthesizeMouse($("img2"), 5, 5, { type: "mousedown" });
synthesizeMouse($("img2"), 5, 5, { type: "mouseup" });
// Flush layout
document.body.offsetWidth;
// Flush out invalidation
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);
utils.processUpdates();
// There's no way to force painting to happen on OS X, maybe a synthesized
// mouse click will do the job?
synthesizeMouse($("image"), 5, 5, { type: "mousedown" });
synthesizeMouse($("otherelement"), 5, 5, { type: "mousemove" });
synthesizeMouse($("image"), 5, 5, { type: "mouseup" });
setTimeout(finishTests, 100);
}
function finishTests() {
// test that setCapture works on an area element (bug 517737)
var area = document.getElementById("area");
synthesizeMouse(area, 5, 5, { type: "mousedown" });