1 <body contentEditable=
"true">
2 <b id=
"bold">bold
</b>regular text
<br>
4 <script src=
"../editing.js"></script>
7 testRunner
.dumpAsText();
14 // Inserting HTML over "regular text" shouldn't be in the bold tag.
15 var bold
= document
.getElementById("bold");
16 var unboldText
= bold
.nextSibling
;
17 execSetSelectionCommand(unboldText
, 0, unboldText
, unboldText
.textContent
.length
);
18 document
.execCommand("insertHTML", false, "<img id='img' src='../resources/abe.png' /> not bold");
20 // Verify that the image isn't in the bold tag.
21 var image
= document
.getElementById("img");
22 if (image
.previousSibling
!= bold
)
23 fail("Image should be adjacent to the bold node.");
25 // Now try inserting HTML over the image.
26 execSetSelectionCommand(image
, 0, image
, 1);
27 document
.execCommand("inserthtml", false, "<span id='red' style='color:red'>red text</span>");
29 // Verify that the red text isn't in the bold tag.
30 var red
= document
.getElementById("red");
31 if (red
.previousSibling
!= bold
)
32 fail("Red text should be adjacent to the bold node.");
34 // Replace text with SUCCESS.
35 document
.body
.innerHTML
= "SUCCESS";