blob: 3846daddffbf37d09e81da6fce381f7d0386a458 [file] [log] [blame]
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<div id="container">
<div id="content" contenteditable><div><ruby>你好<rt>ni hao</rt></ruby></ruby></div>
<ruby><ruby><rt>hen</rt></ruby><ruby><rt>hao</rt></ruby>
</div>
<textarea cols=50 rows=5></textarea>
</div>
<script>
description("This tests copying and pasting text with ruby doesn't insert new lines before and after rt\n"
+ "but still inserts a new line around a block element around ruby."
+ "To manually test, copy and paste the text into the textarea. There should be not new line in the textarea.");
var content = document.getElementById('content');
content.focus();
document.execCommand('SelectAll', false, null);
if (document.queryCommandSupported('Copy')) {
document.execCommand('Copy', false, null);
var textarea = document.querySelector('textarea');
var firstLine = content.firstChild.innerText;
textarea.focus();
document.execCommand('Paste', false, null);
shouldBe("textarea.value.indexOf('\\n')", "firstLine.length");
document.getElementById('container').style.display = 'none';
}
</script>
</body>
</html>