/** Test for Bug 388794 **/
SimpleTest.waitForExplicitFinish();
var pendingLoads = 0;
/* Use regex due to rounding error in Fennec with C++APZ enabled */ var hrefs = {
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]/,
};
function submitFormMouse(idNum) {
$("test"+idNum).setAttribute("onload", "frameLoaded(this)");
// Use 4.99 instead of 5 to guard against the possibility that the
// 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.
synthesizeMouse($("test" + idNum + "image"), 4.99, 4.99, {});
}
addLoadEvent(function() {
// Need the timeout so painting has a chance to be unsuppressed.
setTimeout(function() {
submitForm(++pendingLoads);
submitForm(++pendingLoads);
submitForm(++pendingLoads);
submitForm(++pendingLoads);
submitFormMouse(++pendingLoads);
submitFormMouse(++pendingLoads);
}, 0);
});
function frameLoaded(frame) {
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
);
if (--pendingLoads == 0) {
SimpleTest.finish();
}
}
</script>
</pre>
</body>
</html>
Messung V0.5
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.