2 <p id=
"description"></p>
4 <div id=
"console"></div>
5 <script src=
"../../resources/js-test.js"></script>
7 description('Insert newline into dynamically created textarea');
8 function $(id
) { return document
.getElementById(id
); }
9 function visibleNewline(s
) { return s
.replace(/\n/g, '/'); }
11 var sampleText
= 'hello\n\nworld';
12 var textarea
= document
.createElement('textarea');
14 textarea
.value
= '\n';
15 $('container').appendChild(textarea
);
18 document
.execCommand('Delete', false);
19 document
.execCommand('InsertHtml', false, sampleText
);
20 shouldBeEqualToString('visibleNewline(textarea.value)', visibleNewline(sampleText
));
22 if (window
.testRunner
)
23 $('container').outerHTML
= '';