1 //-------------------------------------------------------------------------------------------------------
2 // Java script library to run editing layout tests
5 var commandDelay = window.location.search.substring(1);
6 if (commandDelay == '')
8 var selection = window.getSelection();
10 //-------------------------------------------------------------------------------------------------------
12 function execSetSelectionCommand(sn, so, en, eo) {
13 window.getSelection().setBaseAndExtent(sn, so, en, eo);
16 // Args are startNode, startOffset, endNode, endOffset
17 function setSelectionCommand(sn, so, en, eo) {
18 if (commandDelay > 0) {
19 queueCommand(execSetSelectionCommand.bind(execSetSelectionCommand, sn, so, en, eo), commandCount * commandDelay);
22 execSetSelectionCommand(sn, so, en, eo);
25 //-------------------------------------------------------------------------------------------------------
27 function execTransposeCharactersCommand() {
28 document.execCommand("Transpose");
30 function transposeCharactersCommand() {
31 if (commandDelay > 0) {
32 queueCommand(execTransposeCharactersCommand, commandCount * commandDelay);
36 execTransposeCharactersCommand();
40 //-------------------------------------------------------------------------------------------------------
42 function execMoveSelectionLeftByCharacterCommand() {
43 selection.modify("move", "left", "character");
45 function moveSelectionLeftByCharacterCommand() {
46 if (commandDelay > 0) {
47 queueCommand(execMoveSelectionLeftByCharacterCommand, commandCount * commandDelay);
51 execMoveSelectionLeftByCharacterCommand();
55 //-------------------------------------------------------------------------------------------------------
57 function execMoveSelectionRightByCharacterCommand() {
58 selection.modify("move", "Right", "character");
60 function moveSelectionRightByCharacterCommand() {
61 if (commandDelay > 0) {
62 queueCommand(execMoveSelectionRightByCharacterCommand, commandCount * commandDelay);
66 execMoveSelectionRightByCharacterCommand();
70 //-------------------------------------------------------------------------------------------------------
72 function execExtendSelectionLeftByCharacterCommand() {
73 selection.modify("extend", "left", "character");
75 function extendSelectionLeftByCharacterCommand() {
76 if (commandDelay > 0) {
77 queueCommand(execExtendSelectionLeftByCharacterCommand, commandCount * commandDelay);
81 execExtendSelectionLeftByCharacterCommand();
85 //-------------------------------------------------------------------------------------------------------
87 function execExtendSelectionRightByCharacterCommand() {
88 selection.modify("extend", "Right", "character");
90 function extendSelectionRightByCharacterCommand() {
91 if (commandDelay > 0) {
92 queueCommand(execExtendSelectionRightByCharacterCommand, commandCount * commandDelay);
96 execExtendSelectionRightByCharacterCommand();
100 //-------------------------------------------------------------------------------------------------------
102 function execMoveSelectionForwardByCharacterCommand() {
103 selection.modify("move", "forward", "character");
105 function moveSelectionForwardByCharacterCommand() {
106 if (commandDelay > 0) {
107 queueCommand(execMoveSelectionForwardByCharacterCommand, commandCount * commandDelay);
111 execMoveSelectionForwardByCharacterCommand();
115 //-------------------------------------------------------------------------------------------------------
117 function execExtendSelectionForwardByCharacterCommand() {
118 selection.modify("extend", "forward", "character");
120 function extendSelectionForwardByCharacterCommand() {
121 if (commandDelay > 0) {
122 queueCommand(execExtendSelectionForwardByCharacterCommand, commandCount * commandDelay);
126 execExtendSelectionForwardByCharacterCommand();
130 //-------------------------------------------------------------------------------------------------------
132 function execMoveSelectionForwardByWordCommand() {
133 selection.modify("move", "forward", "word");
135 function moveSelectionForwardByWordCommand() {
136 if (commandDelay > 0) {
137 queueCommand(execMoveSelectionForwardByWordCommand, commandCount * commandDelay);
141 execMoveSelectionForwardByWordCommand();
145 //-------------------------------------------------------------------------------------------------------
147 function execExtendSelectionForwardByWordCommand() {
148 selection.modify("extend", "forward", "word");
150 function extendSelectionForwardByWordCommand() {
151 if (commandDelay > 0) {
152 queueCommand(execExtendSelectionForwardByWordCommand, commandCount * commandDelay);
156 execExtendSelectionForwardByWordCommand();
160 //-------------------------------------------------------------------------------------------------------
162 function execMoveSelectionForwardBySentenceCommand() {
163 selection.modify("move", "forward", "sentence");
165 function moveSelectionForwardBySentenceCommand() {
166 if (commandDelay > 0) {
167 queueCommand(execMoveSelectionForwardBySentenceCommand, commandCount * commandDelay);
171 execMoveSelectionForwardBySentenceCommand();
175 //-------------------------------------------------------------------------------------------------------
177 function execExtendSelectionForwardBySentenceCommand() {
178 selection.modify("extend", "forward", "sentence");
180 function extendSelectionForwardBySentenceCommand() {
181 if (commandDelay > 0) {
182 queueCommand(execExtendSelectionForwardBySentenceCommand, commandCount * commandDelay);
186 execExtendSelectionForwardBySentenceCommand();
190 //-------------------------------------------------------------------------------------------------------
192 function execMoveSelectionForwardByLineCommand() {
193 selection.modify("move", "forward", "line");
195 function moveSelectionForwardByLineCommand() {
196 if (commandDelay > 0) {
197 queueCommand(execMoveSelectionForwardByLineCommand, commandCount * commandDelay);
201 execMoveSelectionForwardByLineCommand();
205 //-------------------------------------------------------------------------------------------------------
207 function execExtendSelectionForwardByLineCommand() {
208 selection.modify("extend", "forward", "line");
210 function extendSelectionForwardByLineCommand() {
211 if (commandDelay > 0) {
212 queueCommand(execExtendSelectionForwardByLineCommand, commandCount * commandDelay);
216 execExtendSelectionForwardByLineCommand();
220 //-------------------------------------------------------------------------------------------------------
222 function execMoveSelectionForwardByLineBoundaryCommand() {
223 selection.modify("move", "forward", "lineBoundary");
225 function moveSelectionForwardByLineBoundaryCommand() {
226 if (commandDelay > 0) {
227 queueCommand(execMoveSelectionForwardByLineBoundaryCommand, commandCount * commandDelay);
231 execMoveSelectionForwardByLineBoundaryCommand();
235 //-------------------------------------------------------------------------------------------------------
237 function execExtendSelectionForwardByLineBoundaryCommand() {
238 selection.modify("extend", "forward", "lineBoundary");
240 function extendSelectionForwardByLineBoundaryCommand() {
241 if (commandDelay > 0) {
242 queueCommand(execExtendSelectionForwardByLineBoundaryCommand, commandCount * commandDelay);
246 execExtendSelectionForwardByLineBoundaryCommand();
250 //-------------------------------------------------------------------------------------------------------
252 function execMoveSelectionBackwardByCharacterCommand() {
253 selection.modify("move", "backward", "character");
255 function moveSelectionBackwardByCharacterCommand() {
256 if (commandDelay > 0) {
257 queueCommand(execMoveSelectionBackwardByCharacterCommand, commandCount * commandDelay);
261 execMoveSelectionBackwardByCharacterCommand();
265 //-------------------------------------------------------------------------------------------------------
267 function execExtendSelectionBackwardByCharacterCommand() {
268 selection.modify("extend", "backward", "character");
270 function extendSelectionBackwardByCharacterCommand() {
271 if (commandDelay > 0) {
272 queueCommand(execExtendSelectionBackwardByCharacterCommand, commandCount * commandDelay);
276 execExtendSelectionBackwardByCharacterCommand();
280 //-------------------------------------------------------------------------------------------------------
282 function execMoveSelectionBackwardByWordCommand() {
283 selection.modify("move", "backward", "word");
285 function moveSelectionBackwardByWordCommand() {
286 if (commandDelay > 0) {
287 queueCommand(execMoveSelectionBackwardByWordCommand, commandCount * commandDelay);
291 execMoveSelectionBackwardByWordCommand();
295 //-------------------------------------------------------------------------------------------------------
297 function execExtendSelectionBackwardByWordCommand() {
298 selection.modify("extend", "backward", "word");
300 function extendSelectionBackwardByWordCommand() {
301 if (commandDelay > 0) {
302 queueCommand(execExtendSelectionBackwardByWordCommand, commandCount * commandDelay);
306 execExtendSelectionBackwardByWordCommand();
310 //-------------------------------------------------------------------------------------------------------
312 function execMoveSelectionBackwardBySentenceCommand() {
313 selection.modify("move", "backward", "sentence");
315 function moveSelectionBackwardBySentenceCommand() {
316 if (commandDelay > 0) {
317 queueCommand(execMoveSelectionBackwardBySentenceCommand, commandCount * commandDelay);
321 execMoveSelectionBackwardBySentenceCommand();
325 //-------------------------------------------------------------------------------------------------------
327 function execExtendSelectionBackwardBySentenceCommand() {
328 selection.modify("extend", "backward", "sentence");
330 function extendSelectionBackwardBySentenceCommand() {
331 if (commandDelay > 0) {
332 queueCommand(execExtendSelectionBackwardBySentenceCommand, commandCount * commandDelay);
336 execExtendSelectionBackwardBySentenceCommand();
340 //-------------------------------------------------------------------------------------------------------
342 function execMoveSelectionBackwardByLineCommand() {
343 selection.modify("move", "backward", "line");
345 function moveSelectionBackwardByLineCommand() {
346 if (commandDelay > 0) {
347 queueCommand(execMoveSelectionBackwardByLineCommand, commandCount * commandDelay);
351 execMoveSelectionBackwardByLineCommand();
355 //-------------------------------------------------------------------------------------------------------
357 function execExtendSelectionBackwardByLineCommand() {
358 selection.modify("extend", "backward", "line");
360 function extendSelectionBackwardByLineCommand() {
361 if (commandDelay > 0) {
362 queueCommand(execExtendSelectionBackwardByLineCommand, commandCount * commandDelay);
366 execExtendSelectionBackwardByLineCommand();
370 //-------------------------------------------------------------------------------------------------------
372 function execExtendSelectionBackwardByLineBoundaryCommand() {
373 selection.modify("extend", "backward", "lineBoundary");
375 function extendSelectionBackwardByLineBoundaryCommand() {
376 if (commandDelay > 0) {
377 queueCommand(execExtendSelectionBackwardByLineBoundaryCommand, commandCount * commandDelay);
381 execExtendSelectionBackwardByLineBoundaryCommand();
385 //-------------------------------------------------------------------------------------------------------
387 function execMoveSelectionBackwardByLineBoundaryCommand() {
388 selection.modify("move", "backward", "lineBoundary");
390 function moveSelectionBackwardByLineBoundaryCommand() {
391 if (commandDelay > 0) {
392 queueCommand(execMoveSelectionBackwardByLineBoundaryCommand, commandCount * commandDelay);
396 execMoveSelectionBackwardByLineBoundaryCommand();
400 //-------------------------------------------------------------------------------------------------------
402 function doubleClick(x, y) {
403 eventSender.mouseMoveTo(x, y);
404 eventSender.mouseDown();
405 eventSender.mouseUp();
406 eventSender.mouseDown();
407 eventSender.mouseUp();
410 function doubleClickAtSelectionStart() {
411 var rects = window.getSelection().getRangeAt(0).getClientRects();
412 var x = rects[0].left;
413 var y = rects[0].top;
417 //-------------------------------------------------------------------------------------------------------
419 function execBoldCommand() {
420 document.execCommand("Bold");
421 debugForDumpAsText("execBoldCommand");
423 function boldCommand() {
424 if (commandDelay > 0) {
425 queueCommand(execBoldCommand, commandCount * commandDelay);
433 //-------------------------------------------------------------------------------------------------------
435 function execUnderlineCommand() {
436 document.execCommand("Underline");
437 debugForDumpAsText("execUnderlineCommand");
439 function underlineCommand() {
440 if (commandDelay > 0) {
441 queueCommand(execUnderlineCommand, commandCount * commandDelay);
445 execUnderlineCommand();
449 //-------------------------------------------------------------------------------------------------------
451 function execFontNameCommand() {
452 document.execCommand("FontName", false, "Courier");
453 debugForDumpAsText("execFontNameCommand");
455 function fontNameCommand() {
456 if (commandDelay > 0) {
457 queueCommand(execFontNameCommand, commandCount * commandDelay);
461 execFontNameCommand();
465 //-------------------------------------------------------------------------------------------------------
467 function execFontSizeCommand(s) {
468 if (arguments.length == 0 || s == undefined || s.length == 0)
470 document.execCommand("FontSize", false, s);
471 debugForDumpAsText("execFontSizeCommand");
473 function fontSizeCommand(s) {
474 if (commandDelay > 0) {
475 queueCommand(execFontSizeCommand, commandCount * commandDelay, s);
479 execFontSizeCommand(s);
483 //-------------------------------------------------------------------------------------------------------
485 function execFontSizeDeltaCommand(s) {
486 if (arguments.length == 0 || s == undefined || s.length == 0)
488 document.execCommand("FontSizeDelta", false, s);
489 debugForDumpAsText("execFontSizeDeltaCommand");
491 function fontSizeDeltaCommand(s) {
492 if (commandDelay > 0) {
493 queueCommand(execFontSizeDeltaCommand.bind(execFontSizeDeltaCommand, s), commandCount * commandDelay);
497 execFontSizeDeltaCommand(s);
501 //-------------------------------------------------------------------------------------------------------
503 function execItalicCommand() {
504 document.execCommand("Italic");
505 debugForDumpAsText("execItalicCommand");
507 function italicCommand() {
508 if (commandDelay > 0) {
509 queueCommand(execItalicCommand, commandCount * commandDelay);
518 //-------------------------------------------------------------------------------------------------------
520 function execJustifyCenterCommand() {
521 document.execCommand("JustifyCenter");
522 debugForDumpAsText("execJustifyCenterCommand");
524 function justifyCenterCommand() {
525 if (commandDelay > 0) {
526 queueCommand(execJustifyCenterCommand, commandCount * commandDelay);
530 execJustifyCenterCommand();
535 //-------------------------------------------------------------------------------------------------------
537 function execJustifyLeftCommand() {
538 document.execCommand("JustifyLeft");
539 debugForDumpAsText("execJustifyLeftCommand");
541 function justifyLeftCommand() {
542 if (commandDelay > 0) {
543 queueCommand(execJustifyLeftCommand, commandCount * commandDelay);
547 execJustifyLeftCommand();
552 //-------------------------------------------------------------------------------------------------------
554 function execJustifyRightCommand() {
555 document.execCommand("JustifyRight");
556 debugForDumpAsText("execJustifyRightCommand");
558 function justifyRightCommand() {
559 if (commandDelay > 0) {
560 queueCommand(execJustifyRightCommand, commandCount * commandDelay);
564 execJustifyRightCommand();
568 //-------------------------------------------------------------------------------------------------------
570 function execInsertHTMLCommand(html) {
571 document.execCommand("InsertHTML", false, html);
572 debugForDumpAsText("execInsertHTMLCommand");
574 function insertHTMLCommand(html) {
575 if (commandDelay > 0) {
576 queueCommand(execInsertHTMLCommand.bind(execInsertHTMLCommand, html), commandCount * commandDelay);
580 execInsertHTMLCommand(html);
584 //-------------------------------------------------------------------------------------------------------
586 function execInsertImageCommand(imgSrc) {
587 document.execCommand("InsertImage", false, imgSrc);
588 debugForDumpAsText("execInsertImageCommand");
590 function insertImageCommand(imgSrc) {
591 if (commandDelay > 0) {
592 queueCommand(execInsertImageCommand.bind(execInsertImageCommand, imgSrc), commandCount * commandDelay);
596 execInsertImageCommand(imgSrc);
600 //-------------------------------------------------------------------------------------------------------
602 function execInsertLineBreakCommand() {
603 document.execCommand("InsertLineBreak");
604 debugForDumpAsText("execInsertLineBreakCommand");
606 function insertLineBreakCommand() {
607 if (commandDelay > 0) {
608 queueCommand(execInsertLineBreakCommand, commandCount * commandDelay);
612 execInsertLineBreakCommand();
616 //-------------------------------------------------------------------------------------------------------
618 function execInsertParagraphCommand() {
619 document.execCommand("InsertParagraph");
620 debugForDumpAsText("execInsertParagraphCommand");
622 function insertParagraphCommand() {
623 if (commandDelay > 0) {
624 queueCommand(execInsertParagraphCommand, commandCount * commandDelay);
628 execInsertParagraphCommand();
632 //-------------------------------------------------------------------------------------------------------
634 function execInsertNewlineInQuotedContentCommand() {
635 document.execCommand("InsertNewlineInQuotedContent");
636 debugForDumpAsText("execInsertNewlineInQuotedContentCommand");
638 function insertNewlineInQuotedContentCommand() {
639 if (commandDelay > 0) {
640 queueCommand(execInsertNewlineInQuotedContentCommand, commandCount * commandDelay);
644 execInsertNewlineInQuotedContentCommand();
648 //-------------------------------------------------------------------------------------------------------
650 function execTypeCharacterCommand(c) {
651 if (arguments.length == 0 || c == undefined || c.length == 0 || c.length > 1)
653 document.execCommand("InsertText", false, c);
654 debugForDumpAsText("execTypeCharacterCommand");
656 function typeCharacterCommand(c) {
657 if (commandDelay > 0) {
658 queueCommand(execTypeCharacterCommand.bind(execTypeCharacterCommand, c), commandCount * commandDelay);
662 execTypeCharacterCommand(c);
666 //-------------------------------------------------------------------------------------------------------
668 function execSelectAllCommand() {
669 document.execCommand("SelectAll");
671 function selectAllCommand() {
672 if (commandDelay > 0) {
673 queueCommand(execSelectAllCommand, commandCount * commandDelay);
677 execSelectAllCommand();
681 //-------------------------------------------------------------------------------------------------------
683 function execStrikethroughCommand() {
684 document.execCommand("Strikethrough");
685 debugForDumpAsText("execStrikethroughCommand");
687 function strikethroughCommand() {
688 if (commandDelay > 0) {
689 queueCommand(execStrikethroughCommand, commandCount * commandDelay);
693 execStrikethroughCommand();
697 //-------------------------------------------------------------------------------------------------------
699 function execUndoCommand() {
700 document.execCommand("Undo");
701 debugForDumpAsText("execUndoCommand");
703 function undoCommand() {
704 if (commandDelay > 0) {
705 queueCommand(execUndoCommand, commandCount * commandDelay);
713 //-------------------------------------------------------------------------------------------------------
715 function execRedoCommand() {
716 document.execCommand("Redo");
717 debugForDumpAsText("execRedoCommand");
719 function redoCommand() {
720 if (commandDelay > 0) {
721 queueCommand(execRedoCommand, commandCount * commandDelay);
729 //-------------------------------------------------------------------------------------------------------
731 function execChangeRootSize() {
732 document.getElementById("root").style.width = "600px";
734 function changeRootSize() {
735 if (commandDelay > 0) {
736 queueCommand(execChangeRootSize, commandCount * commandDelay);
740 execChangeRootSize();
744 //-------------------------------------------------------------------------------------------------------
746 function execCutCommand() {
747 document.execCommand("Cut");
748 debugForDumpAsText("execCutCommand");
750 function cutCommand() {
751 if (commandDelay > 0) {
752 queueCommand(execCutCommand, commandCount * commandDelay);
760 //-------------------------------------------------------------------------------------------------------
762 function execCopyCommand() {
763 document.execCommand("Copy");
764 debugForDumpAsText("execCopyCommand");
766 function copyCommand() {
767 if (commandDelay > 0) {
768 queueCommand(execCopyCommand, commandCount * commandDelay);
776 //-------------------------------------------------------------------------------------------------------
778 function execPasteCommand() {
779 document.execCommand("Paste");
780 debugForDumpAsText("execPasteCommand");
782 function pasteCommand() {
783 if (commandDelay > 0) {
784 queueCommand(execPasteCommand, commandCount * commandDelay);
792 //-------------------------------------------------------------------------------------------------------
794 function execCreateLinkCommand(url) {
795 document.execCommand("CreateLink", false, url);
796 debugForDumpAsText("execCreateLinkCommand");
798 function createLinkCommand(url) {
799 if (commandDelay > 0) {
800 queueCommand(execCreateLinkCommand.bind(execCreateLinkCommand, url), commandCount * commandDelay);
803 execCreateLinkCommand(url);
806 //-------------------------------------------------------------------------------------------------------
808 function execUnlinkCommand() {
809 document.execCommand("Unlink");
810 debugForDumpAsText("execUnlinkCommand");
812 function unlinkCommand() {
813 if (commandDelay > 0) {
814 queueCommand(execUnlinkCommand, commandCount * commandDelay);
820 //-------------------------------------------------------------------------------------------------------
822 function execPasteAndMatchStyleCommand() {
823 document.execCommand("PasteAndMatchStyle");
824 debugForDumpAsText("execPasteAndMatchStyleCommand");
826 function pasteAndMatchStyleCommand() {
827 if (commandDelay > 0) {
828 queueCommand(execPasteAndMatchStyleCommand, commandCount * commandDelay);
832 execPasteAndMatchStyleCommand();
836 //-------------------------------------------------------------------------------------------------------
838 function execDeleteCommand() {
839 document.execCommand("Delete");
840 debugForDumpAsText("execDeleteCommand");
842 function deleteCommand() {
843 if (commandDelay > 0) {
844 queueCommand(execDeleteCommand, commandCount * commandDelay);
852 //-------------------------------------------------------------------------------------------------------
854 function execForwardDeleteCommand() {
855 document.execCommand("ForwardDelete");
856 debugForDumpAsText("execForwardDeleteCommand");
858 function forwardDeleteCommand() {
859 if (commandDelay > 0) {
860 queueCommand(execForwardDeleteCommand, commandCount * commandDelay);
864 execForwardDeleteCommand();
868 //-------------------------------------------------------------------------------------------------------
875 function queueCommand(callback) {
876 queue.push(callback);
878 if (window.testRunner)
879 testRunner.waitUntilDone();
880 timer = setTimeout(runCommand, commandDelay);
884 function runCommand() {
887 if (i < queue.length)
888 setTimeout(runCommand, commandDelay);
889 else if (window.testRunner)
890 testRunner.notifyDone();
893 window.queueCommand = queueCommand;
896 function focusOnFirstTextInTestElementIfExists() {
897 var elem = document.getElementById("test");
898 var selection = window.getSelection();
900 var traverse = function (node, offset, condition) {
901 var obj = condition(node, offset);
905 var children = node.childNodes;
906 var len = children.length;
907 for (var i = 0; i < len; i++) {
908 var child = children[i];
909 obj = traverse(child, i, condition);
916 var firstVisiblePosition = traverse(elem, 0, function (node, offset) {
917 if (node.nodeName == '#text') {
919 while (offset < node.textContent.length && node.textContent[offset] == '\n')
921 return { 'node': node, 'offset': offset };
924 if (node.nodeName == 'BR' || node.nodeName == 'IMG')
925 return { 'node': node.parentNode, 'offset': offset };
930 if (firstVisiblePosition)
931 selection.collapse(firstVisiblePosition.node, firstVisiblePosition.offset);
933 selection.collapse(elem, 0);
935 selection.removeAllRanges();
939 function runEditingTest() {
940 if (window.testRunner)
941 testRunner.dumpEditingCallbacks();
943 focusOnFirstTextInTestElementIfExists();
948 var dumpAsText = false;
949 var elementsForDumpingMarkupList = [document.createElement('ol')];
951 function runDumpAsTextEditingTest(enableCallbacks) {
952 if (window.testRunner) {
953 testRunner.dumpAsText();
955 testRunner.dumpEditingCallbacks();
960 focusOnFirstTextInTestElementIfExists();
964 for (var i = 0; i < elementsForDumpingMarkupList.length; i++)
965 document.body.appendChild(elementsForDumpingMarkupList[i]);
968 function debugForDumpAsText(name) {
969 if (dumpAsText && document.getElementById("root")) {
970 var newItem = document.createElement('li');
971 newItem.appendChild(document.createTextNode(name+": "+document.getElementById("root").innerHTML));
972 elementsForDumpingMarkupList[elementsForDumpingMarkupList.length - 1].appendChild(newItem);
976 function startNewMarkupGroup(label) {
977 if (!elementsForDumpingMarkupList[elementsForDumpingMarkupList.length - 1].hasChildNodes())
978 elementsForDumpingMarkupList.pop();
979 elementsForDumpingMarkupList.push(document.createElement('br'));
980 elementsForDumpingMarkupList.push(document.createTextNode(label));
981 elementsForDumpingMarkupList.push(document.createElement('ol'));
984 //-------------------------------------------------------------------------------------------------------
987 function execBackColorCommand() {
988 document.execCommand("BackColor", false, "Chartreuse");
989 debugForDumpAsText('execBackColorCommand');
991 function backColorCommand() {
992 if (commandDelay > 0) {
993 queueCommand(execBackColorCommand, commandCount * commandDelay);
997 execBackColorCommand();
1002 function execForeColorCommand(color) {
1003 document.execCommand("ForeColor", false, color);
1004 debugForDumpAsText('execForeColorCommand');
1006 function foreColorCommand(color) {
1007 if (commandDelay > 0) {
1008 queueCommand(execForeColorCommand.bind(execForeColorCommand, color), commandCount * commandDelay);
1011 execForeColorCommand(color);
1014 //-------------------------------------------------------------------------------------------------------
1017 function runCommand(command, arg1, arg2) {
1018 document.execCommand(command,arg1,arg2);
1021 function executeCommand(command,arg1,arg2) {
1022 if (commandDelay > 0) {
1023 queueCommand(runCommand, commandCount * commandDelay);
1027 runCommand(command,arg1,arg2);