Reviewed by John
[WebKit-https.git] / LayoutTests / editing / editing.js
index ede0c58..ff3da95 100644 (file)
@@ -39,6 +39,36 @@ function extendSelectionForwardByCharacterCommand() {
 
 //-------------------------------------------------------------------------------------------------------
 
+function execMoveSelectionForwardByWordCommand() {
+    selection.modify("move", "forward", "word");
+}
+function moveSelectionForwardByWordCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execMoveSelectionForwardByWordCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execMoveSelectionForwardByWordCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function execExtendSelectionForwardByWordCommand() {
+    selection.modify("extend", "forward", "word");
+}
+function extendSelectionForwardByWordCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execExtendSelectionForwardByWordCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execExtendSelectionForwardByWordCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
 function execMoveSelectionForwardByLineCommand() {
     selection.modify("move", "forward", "line");
 }
@@ -99,6 +129,36 @@ function extendSelectionBackwardByCharacterCommand() {
 
 //-------------------------------------------------------------------------------------------------------
 
+function execMoveSelectionBackwardByWordCommand() {
+    selection.modify("move", "backward", "word");
+}
+function moveSelectionBackwardByWordCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execMoveSelectionBackwardByWordCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execMoveSelectionBackwardByWordCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function execExtendSelectionBackwardByWordCommand() {
+    selection.modify("extend", "backward", "word");
+}
+function extendSelectionBackwardByWordCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execExtendSelectionBackwardByWordCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execExtendSelectionBackwardByWordCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
 function execMoveSelectionBackwardByLineCommand() {
     selection.modify("move", "backward", "line");
 }
@@ -161,16 +221,79 @@ function italicCommand() {
 
 //-------------------------------------------------------------------------------------------------------
 
-function execInsertNewlineCommand() {
-    document.execCommand("InsertNewline");
+function execJustifyCenterCommand() {
+    document.execCommand("JustifyCenter");
+}
+function justifyCenterCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execJustifyCenterCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execJustifyCenterCommand();
+    }
+}
+
+
+//-------------------------------------------------------------------------------------------------------
+
+function execJustifyLeftCommand() {
+    document.execCommand("JustifyLeft");
+}
+function justifyLeftCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execJustifyLeftCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execJustifyLeftCommand();
+    }
+}
+
+
+//-------------------------------------------------------------------------------------------------------
+
+function execJustifyRightCommand() {
+    document.execCommand("JustifyRight");
+}
+function justifyRightCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execJustifyRightCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execJustifyRightCommand();
+    }
+}
+
+
+//-------------------------------------------------------------------------------------------------------
+
+function execInsertLineBreakCommand() {
+    document.execCommand("InsertLineBreak");
+}
+function insertLineBreakCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execInsertLineBreakCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execInsertLineBreakCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+function execInsertParagraphCommand() {
+    document.execCommand("InsertParagraph");
 }
-function insertNewlineCommand() {
+function insertParagraphCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execInsertNewlineCommand, commandCount * commandDelay);
+        window.setTimeout(execInsertParagraphCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
-        execInsertNewlineCommand();
+        execInsertParagraphCommand();
     }
 }