1
edit
Changes
no edit summary
</html>
</source>
dseif applied patch to firefox
<source lang="javascript">
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=565031
-->
<head>
<title>Test for Bug 565031</title>
<script src="/MochiKit/packed.js"></script>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script src="/tests/SimpleTest/EventUtils.js"></script>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=565031">Mozilla Bug 565031</a>
<p id="display">
<map name=a>
<area coords="0,0,5,5" onclick="commas = true;">
<area coords="5 5 10 10" onclick="spaces = true;">
<area coords="10;10;15;15" onclick="semicolons = true;">
<area coords="15 15 20 20" onclick="tabs = true;">
<!-- Coords dynamically set below for test5,test6, and test7 -->
<area id="test5" onclick="newline = true;">
<area id="test6" onclick="carriageReturn = true;">
<area id="test7" onclick="verticalTabs = true;">
</map>
<img src="file_Dolske.png" usemap="#a" id="image">
</p>
<div id="content" style="display: none">
</div>
<pre id="test">
<script>
/** Test for Bug 565031 **/
var commas = false,
spaces = false,
semicolons = false,
tabs = false,
newline = false,
carriageReturn = false,
verticalTabs = false;
SimpleTest.waitForExplicitFinish();
function tester() {
var image = document.getElementById("image");
synthesizeMouse(image, 3, 3, {});
synthesizeMouse(image, 7, 7, {});
synthesizeMouse(image, 13, 13, {});
synthesizeMouse(image, 17, 17, {});
synthesizeMouse(image, 23, 23, {});
synthesizeMouse(image, 27, 27, {});
synthesizeMouse(image, 33, 33, {});
// These test should pass
ok(commas, "Failed to parse commas.");
ok(spaces, "Failed to parse spaces");
ok(semicolons, "Failed to parse semicolons.");
// The next 4 tests should fail
ok(!tabs, "Tabs should not be parsed");
ok(!newline, "Newline characters should not be parsed");
ok(!carriageReturn, "Carriage returns should not be parsed");
ok(!verticalTabs, "Vertical tabs should not be parsed");
SimpleTest.finish();
}
function runTest() {
document.getElementById("test5").coords = "20\n20\n25\n25";
document.getElementById("test6").coords = "25\r25\r30\r30";
document.getElementById("test7").coords = "30\v30\v35\v35";
SimpleTest.waitForFocus(tester);
}
addLoadEvent(runTest);
</script>
</pre>
</body>
</html>
</source>