Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / selection / regional-indicators.html
blob77d95ba7c446ae868889e20d0bf4308d565eb502
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
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>
10 <script>
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()", "'🇯🇵'");
28 </script>
29 </body>
30 </html>