tizen beta release
[profile/ivi/webkit-efl.git] / LayoutTests / editing / selection / regional-indicators.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
4 <script src="../../fast/js/resources/js-test-pre.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>
11
12 var div = document.getElementById("test");
13 var afterLastIndicator = document.createRange();
14
15 afterLastIndicator.setStart(div.firstChild, 12);
16 document.getSelection().addRange(afterLastIndicator);
17 document.getSelection().modify("extend", "left", "character");
18 shouldBe("document.getSelection().toString()", "'🇯🇵'");
19
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()", "'🇯🇵'");
26
27
28 </script>
29 <script src="../../fast/js/resources/js-test-post.js"></script>
30 </body>
31 </html>