haikuwebkit/LayoutTests/accessibility/mac/text-marker-range-for-node-...

35 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<div id="container" aria-label="parent level">
a <div id="textbox" aria-label="child level" contenteditable="true"></div> b
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that creating TextMarkerRange from nodes that have no children won't collapse to one side.");
if (window.accessibilityController) {
var textbox = accessibilityController.accessibleElementById("textbox");
var textboxRange = textbox.textMarkerRangeForElement(textbox);
// The range should include the div element.
shouldBeTrue("textbox.textMarkerRangeLength(textboxRange) == 1");
// Make sure the node that associates with the text marker is the parent div element.
var startMarker = textbox.startTextMarkerForTextMarkerRange(textboxRange);
var endMarker = textbox.endTextMarkerForTextMarkerRange(textboxRange);
shouldBe("textbox.accessibilityElementForTextMarker(startMarker).description", "'AXDescription: parent level'");
shouldBe("textbox.accessibilityElementForTextMarker(endMarker).description", "'AXDescription: parent level'");
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>