2 function $(id
) { return document
.getElementById(id
); }
6 description('Replace in heading by heading');
8 var selection
= window
.getSelection();
9 var range
= document
.createRange();
10 range
.selectNodeContents($('destination'));
11 selection
.addRange(range
);
12 document
.execCommand('insertHTML', false, '<h2>source</h2>');
13 shouldBeEqualToString('$("destination").textContent', 'source');
15 if (window
.testRunner
)
16 $('content').outerHTML
= '';
22 <p id=
"description"></p>
23 <h1 contenteditable=
"true" id=
"destination">destination
</h1>
25 <div id=
"console"></div>
26 <script src=
"../../resources/js-test.js"></script>