<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<p>This test checks how character breaks are computed for regional indicator characters.</p>
<div contenteditable id="test">🇯🇵🇯🇵🇯🇵</div> <!-- (j)(p)(j)(p)(j)(p) -->
<div id="console"></div>
<script>

var div = document.getElementById("test");
var afterLastIndicator = document.createRange();

afterLastIndicator.setStart(div.firstChild, 12);
document.getSelection().addRange(afterLastIndicator);
document.getSelection().modify("extend", "left", "character");
shouldBe("document.getSelection().toString()", "'🇯🇵'");

div.innerText = "🇯🇵🇯🇵";
afterLastIndicator.setStart(div.firstChild, 8);
getSelection().removeAllRanges();
document.getSelection().addRange(afterLastIndicator);
document.getSelection().modify("extend", "left", "character");
shouldBe("document.getSelection().toString()", "'🇯🇵'");


</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>
