blob: 1a54ced49fdf8299db88a8f3928db770ab97f117 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body id="body">
<input type="text" value="Hello Text" id="text"><br>
<img src="asdf" width="500" height="500" usemap="#map">
<map name="map">
<area shape="rect" coords="0, 0, 500, 500" href="asdf" role="textbox">
</map>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that an invalid position for rangeForPosition will not crash.");
if (window.accessibilityController) {
document.getElementById("text").focus();
var textField = accessibilityController.focusedElement;
// Generate a hit test onto a node that will not have a renderer (the image map).
// This will create an invalidate VisiblePosition and lead to a crash/assert.
shouldBe("textField.rangeForPosition(textField.x + 5, textField.y - 25)", "'{0, 0}'");
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>