Bug 1854553 - Update cron to trigger snap-upstream-test instead of snap-upstream...
[gecko.git] / editor / reftests / 388980-1.html
blobf2e7d0de0e84869f7dd5da7cef63244126d81a02
1 <html>
2 <head>
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>'
10 +'</body></html>';
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');
25 doc.write(text);
26 doc.close();
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");
37 </script>
38 </head>
39 <body>
40 <iframe id="theIFrame" onload="initIFrame()">
41 </iframe>
42 </body>
43 </html>