2008-11-03 05:33:04 +03:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=388794
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Test for Bug 388794</title>
|
|
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
|
|
<style>
|
|
|
|
input { padding: 0; margin: 0; border: none; }
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=388794">Mozilla Bug 388794</a>
|
|
|
|
<p id="display">
|
2017-05-09 07:00:13 +03:00
|
|
|
<form action="dummy_page.html" target="test1" method="GET">
|
2008-11-03 05:33:04 +03:00
|
|
|
<input id="test1image" type="image" name="testImage">
|
|
|
|
</form>
|
2017-05-09 07:00:13 +03:00
|
|
|
<form action="dummy_page.html" target="test2" method="GET">
|
2008-11-03 05:33:04 +03:00
|
|
|
<input id="test2image" type="image">
|
|
|
|
</form>
|
2017-05-09 07:00:13 +03:00
|
|
|
<form action="dummy_page.html" target="test3" method="GET">
|
2008-11-03 05:33:04 +03:00
|
|
|
<input id="test3image" type="image" src="nnc_lockup.gif" name="testImage">
|
|
|
|
</form>
|
2017-05-09 07:00:13 +03:00
|
|
|
<form action="dummy_page.html" target="test4" method="GET">
|
2008-11-03 05:33:04 +03:00
|
|
|
<input id="test4image" type="image" src="nnc_lockup.gif">
|
|
|
|
</form>
|
2017-05-09 07:00:13 +03:00
|
|
|
<form action="dummy_page.html" target="test5" method="GET">
|
2008-11-03 05:33:04 +03:00
|
|
|
<input id="test5image" type="image" src="nnc_lockup.gif" name="testImage">
|
|
|
|
</form>
|
2017-05-09 07:00:13 +03:00
|
|
|
<form action="dummy_page.html" target="test6" method="GET">
|
2008-11-03 05:33:04 +03:00
|
|
|
<input id="test6image" type="image" src="nnc_lockup.gif">
|
|
|
|
</form>
|
|
|
|
<iframe name="test1" id="test1"></iframe>
|
|
|
|
<iframe name="test2" id="test2"></iframe>
|
|
|
|
<iframe name="test3" id="test3"></iframe>
|
|
|
|
<iframe name="test4" id="test4"></iframe>
|
|
|
|
<iframe name="test5" id="test5"></iframe>
|
|
|
|
<iframe name="test6" id="test6"></iframe>
|
|
|
|
</p>
|
|
|
|
<div id="content" style="display: none">
|
2018-11-01 16:48:48 +03:00
|
|
|
|
2008-11-03 05:33:04 +03:00
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
<script type="application/javascript">
|
|
|
|
|
|
|
|
/** Test for Bug 388794 **/
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
|
|
|
|
var pendingLoads = 0;
|
2015-11-20 05:40:05 +03:00
|
|
|
/* Use regex due to rounding error in Fennec with C++APZ enabled */
|
2008-11-03 05:33:04 +03:00
|
|
|
var hrefs = {
|
2017-05-09 07:00:13 +03:00
|
|
|
test1: /\?testImage\.x=0&testImage\.y=0/,
|
|
|
|
test2: /\?x=0&y=0/,
|
|
|
|
test3: /\?testImage\.x=0&testImage\.y=0/,
|
|
|
|
test4: /\?x=0&y=0/,
|
|
|
|
test5: /\?testImage\.x=[4-6]&testImage\.y=[4-6]/,
|
|
|
|
test6: /\?x=[4-6]&y=[4-6]/,
|
2008-11-03 05:33:04 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
function submitForm(idNum) {
|
|
|
|
$("test"+idNum).setAttribute("onload", "frameLoaded(this)");
|
2011-12-16 17:38:45 +04:00
|
|
|
$("test" + idNum + "image").focus();
|
|
|
|
sendKey("return");
|
2008-11-03 05:33:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function submitFormMouse(idNum) {
|
|
|
|
$("test"+idNum).setAttribute("onload", "frameLoaded(this)");
|
2013-11-01 09:14:00 +04:00
|
|
|
// Use 4.99 instead of 5 to guard against the possibility that the
|
2012-05-10 09:24:20 +04:00
|
|
|
// image's 'top' is exactly N + 0.5 pixels from the root. In that case
|
|
|
|
// we'd round up the widget mouse coordinate to N + 6, which relative
|
|
|
|
// to the image would be 5.5, which would get rounded up to 6 when
|
|
|
|
// submitting the form. Instead we round the widget mouse coordinate to
|
|
|
|
// N + 5, which relative to the image would be 4.5 which gets rounded up
|
|
|
|
// to 5.
|
2013-11-01 09:14:00 +04:00
|
|
|
synthesizeMouse($("test" + idNum + "image"), 4.99, 4.99, {});
|
2008-11-03 05:33:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
addLoadEvent(function() {
|
|
|
|
// Need the timeout so painting has a chance to be unsuppressed.
|
|
|
|
setTimeout(function() {
|
|
|
|
submitForm(++pendingLoads);
|
|
|
|
submitForm(++pendingLoads);
|
|
|
|
submitForm(++pendingLoads);
|
|
|
|
submitForm(++pendingLoads);
|
2008-11-27 00:52:42 +03:00
|
|
|
submitFormMouse(++pendingLoads);
|
|
|
|
submitFormMouse(++pendingLoads);
|
2008-11-03 05:33:04 +03:00
|
|
|
}, 0);
|
|
|
|
});
|
|
|
|
|
|
|
|
function frameLoaded(frame) {
|
2018-11-01 16:48:48 +03:00
|
|
|
ok(
|
|
|
|
hrefs[frame.name].test(frame.contentWindow.location.href),
|
|
|
|
"Unexpected href for frame " + frame.name + " - " +
|
|
|
|
"expected to match: " + hrefs[frame.name].toString() + " got: " + frame.contentWindow.location.href
|
|
|
|
);
|
2008-11-03 05:33:04 +03:00
|
|
|
if (--pendingLoads == 0) {
|
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|