blob: 9fe0f823c742a14185834e639cc5beca7b2c3083 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<title>Text Marker for Bounds</title>
</head>
<body>
<div id="text">Text text text text text text text text text text.</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that endTextMarkerForBounds and startTextMarkerForBounds work correctly.");
if (window.accessibilityController) {
var text = accessibilityController.accessibleElementById("text");
var startMarker = text.startTextMarkerForBounds(text.x, text.y, text.width, text.height);
var endMarker = text.endTextMarkerForBounds(text.x, text.y, text.width, text.height);
// Get text range from boundary markers.
var rangeFromBounds = text.textMarkerRangeLength(text.textMarkerRangeForMarkers(startMarker, endMarker));
// Get text range from element.
var rangeFromElement = text.textMarkerRangeLength(text.textMarkerRangeForElement(text));
shouldBe("rangeFromBounds", "rangeFromElement");
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>