3 <body contentEditable=
"true">
11 <script src=
"../editing.js"></script>
13 if (window
.testRunner
)
14 testRunner
.dumpAsText();
21 // Inserting HTML to replace the "line" in the "Second line" should not insert an extra div (line break).
22 var targetDiv
= document
.getElementById("secondDiv");
23 var targetText
= targetDiv
.firstChild
;
24 execSetSelectionCommand(targetText
, 8, targetText
, targetText
.textContent
.length
);
25 document
.execCommand("inserthtml", false, "<span id='red' style='color:red'>line</span>");
27 // Verify that the font still only has one div.
28 var font
= document
.getElementById("fonts");
29 var divs
= font
.querySelectorAll("div");
31 fail("An extra div is inserted which is incorrect. There are " + divs
.length
+ " divs inside font element.");
33 // Inserting HTML into "Second line" should not insert an extra div (line break).
34 execSetSelectionCommand(targetText
, 8, targetText
, 8);
35 document
.execCommand("inserthtml", false, "<span id='green' style='color:green'>green</span>");
37 // Verify that the font still only has one div.
38 var font
= document
.getElementById("fonts");
39 var divs
= font
.querySelectorAll("div");
41 fail("An extra div is inserted which is incorrect. There are " + divs
.length
+ " divs inside font element.");
43 // Replace text with SUCCESS.
44 document
.body
.innerHTML
= "SUCCESS";