3 <meta http-equiv=
"Content-Type" content=
"text/html; charset=UTF-8"/>
4 <script src=
"../../resources/js-test.js"></script>
7 <p>This test checks how character breaks are computed for regional indicator characters.
</p>
8 <div contenteditable
id=
"test">🇯🇵🇯🇵🇯🇵
</div> <!-- (j)(p)(j)(p)(j)(p) -->
9 <div id=
"console"></div>
12 var div
= document
.getElementById("test");
13 var afterLastIndicator
= document
.createRange();
15 afterLastIndicator
.setStart(div
.firstChild
, 12);
16 document
.getSelection().addRange(afterLastIndicator
);
17 document
.getSelection().modify("extend", "left", "character");
18 shouldBe("document.getSelection().toString()", "'🇯🇵'");
20 div
.innerText
= "🇯🇵🇯🇵";
21 afterLastIndicator
.setStart(div
.firstChild
, 8);
22 getSelection().removeAllRanges();
23 document
.getSelection().addRange(afterLastIndicator
);
24 document
.getSelection().modify("extend", "left", "character");
25 shouldBe("document.getSelection().toString()", "'🇯🇵'");