Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / editing / pasteboard / copy-paste-ruby-text-with-block.html
blob284a289c7c787b459a93dee1d756b36af9d20ac1
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 <div id="container">
8 <div id="content" contenteditable><div><ruby>你好<rt>ni hao</rt></ruby></ruby></div>
9 <ruby><ruby><rt>hen</rt></ruby><ruby><rt>hao</rt></ruby>
10 </div>
11 <textarea cols=50 rows=5></textarea>
12 </div>
13 <script>
15 description("This tests copying and pasting text with ruby doesn't insert new lines before and after rt\n"
16 + "but still inserts a new line around a block element around ruby."
17 + "To manually test, copy and paste the text into the textarea. There should be not new line in the textarea.");
19 var content = document.getElementById('content');
20 content.focus();
21 document.execCommand('SelectAll', false, null);
22 if (document.queryCommandSupported('Copy')) {
23 document.execCommand('Copy', false, null);
25 var textarea = document.querySelector('textarea');
26 var firstLine = content.firstChild.innerText;
27 textarea.focus();
28 document.execCommand('Paste', false, null);
29 shouldBe("textarea.value.indexOf('\\n')", "firstLine.length");
31 document.getElementById('container').style.display = 'none';
34 </script>
35 </body>
36 </html>