3 <title>Reftest for bug
388980</title></html>
4 <script type=
"text/javascript">
6 var text
= '<html><head></head><body style="font-size:16px;">'
7 + '<p id="redpar">This paragraph should be red</p>'
8 + '<p id="bluepar">This paragraph should be blue</p>'
9 + '<p>This paragraph should not be colored</p>'
13 function colorPar(par
, color
) {
14 var doc
= document
.getElementById('theIFrame').contentDocument
;
15 var win
= document
.getElementById('theIFrame').contentWindow
;
16 win
.getSelection().selectAllChildren(doc
.getElementById(par
));
17 doc
.execCommand("hilitecolor", false, color
);
18 win
.getSelection().removeAllRanges();
21 function initIFrame() {
22 var doc
= document
.getElementById('theIFrame').contentDocument
;
23 doc
.designMode
= 'on';
24 doc
.open('text/html');
28 // Test hilighting with styleWithCSS, should hilight the text...
29 doc
.execCommand("styleWithCSS", false, true);
30 colorPar("redpar", "red");
32 // Test highlighting without styleWithCSS, should also work.
33 doc
.execCommand("styleWithCSS", false, false);
34 colorPar("bluepar", "blue");
40 <iframe id=
"theIFrame" onload=
"initIFrame()">