--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+ RenderInline {SPAN} at (0,0) size 74x28
+ RenderText {TEXT} at (14,14) size 40x28
+ text run at (14,14) width 40: "test "
+ RenderInline {MAP} at (0,0) size 0x0
+ RenderText {TEXT} at (54,14) size 34x28
+ text run at (54,14) width 34: "test"
+ RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start: position 0 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream: position 0 of of root {DIV}
+downstream: position 0 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
--- /dev/null
+<html>
+<head>
+
+<style>
+.editing {
+ border: 2px solid red;
+ padding: 12px;
+ font-size: 24px;
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+ for (i = 0; i < 9; i++)
+ moveSelectionForwardByCharacterCommand();
+ for (i = 0; i < 9; i++)
+ deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title>
+</head>
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">
+test <map name=m><area coords="0,0,0,0" href=''></map> test
+</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {DIV} at (0,0) size 784x84 [border: (2px solid #FF0000)]
+ RenderBlock (anonymous) at (14,14) size 756x28
+ RenderText {TEXT} at (0,0) size 42x28
+ text run at (0,0) width 42: "Test"
+ RenderBlock {DIV} at (14,42) size 756x28
+ RenderText {TEXT} at (0,0) size 42x28
+ text run at (0,0) width 42: "Test"
--- /dev/null
+<html>
+<head>
+
+<style>
+.editing {
+ border: 2px solid red;
+ padding: 12px;
+ font-size: 24px;
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+ for (i = 0; i < 5; i++) {
+ extendSelectionForwardByCharacterCommand();
+ }
+ deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title>
+</head>
+<body>
+<div contenteditable id="root" class="editing">
+Test
+<div>Test</div>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
//-------------------------------------------------------------------------------------------------------
+function execMoveSelectionForwardByLineCommand() {
+ selection.modify("move", "forward", "line");
+}
+function moveSelectionForwardByLineCommand() {
+ if (commandDelay > 0) {
+ window.setTimeout(execMoveSelectionForwardByLineCommand, commandCount * commandDelay);
+ commandCount++;
+ }
+ else {
+ execMoveSelectionForwardByLineCommand();
+ }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
function execExtendSelectionForwardByLineCommand() {
selection.modify("extend", "forward", "line");
}
-function extendSelectionForwardByCharacterCommand() {
+function extendSelectionForwardByLineCommand() {
if (commandDelay > 0) {
- window.setTimeout(execExtendSelectionForwardByCharacterCommand, commandCount * commandDelay);
+ window.setTimeout(execExtendSelectionForwardByLineCommand, commandCount * commandDelay);
commandCount++;
}
else {
- execExtendSelectionForwardByCharacterCommand();
+ execExtendSelectionForwardByLineCommand();
}
}
+
//-------------------------------------------------------------------------------------------------------
function execMoveSelectionBackwardByCharacterCommand() {
//-------------------------------------------------------------------------------------------------------
+function execMoveSelectionBackwardByLineCommand() {
+ selection.modify("move", "backward", "line");
+}
+function moveSelectionBackwardByLineCommand() {
+ if (commandDelay > 0) {
+ window.setTimeout(execMoveSelectionBackwardByLineCommand, commandCount * commandDelay);
+ commandCount++;
+ }
+ else {
+ execMoveSelectionBackwardByLineCommand();
+ }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function execExtendSelectionBackwardByLineCommand() {
+ selection.modify("extend", "backward", "line");
+}
+function extendSelectionBackwardByLineCommand() {
+ if (commandDelay > 0) {
+ window.setTimeout(execExtendSelectionBackwardByLineCommand, commandCount * commandDelay);
+ commandCount++;
+ }
+ else {
+ execExtendSelectionBackwardByLineCommand();
+ }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
function execBoldCommand() {
document.execCommand("Bold");
}
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {DIV} at (0,0) size 784x208 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (14,38) size 756x132
+ RenderBlock {BLOCKQUOTE} at (40,0) size 676x28
+ RenderText {TEXT} at (0,0) size 42x28
+ text run at (0,0) width 42: "Test"
+ RenderBlock (anonymous) at (0,52) size 756x28
+ RenderText {TEXT} at (0,0) size 12x28
+ text run at (0,0) width 12: "x"
+ RenderBR {BR} at (0,0) size 0x28
+ RenderText {TEXT} at (0,0) size 0x0
+ RenderBlock {BLOCKQUOTE} at (40,104) size 676x28
+ RenderText {TEXT} at (0,0) size 42x28
+ text run at (0,0) width 42: "Test"
+selection is CARET:
+start: position 1 of child 2 {TEXT} of child 2 {DIV} of root {DIV}
+upstream: position 1 of child 2 {TEXT} of child 2 {DIV} of root {DIV}
+downstream: position 0 of child 3 {BR} of child 2 {DIV} of root {DIV}
--- /dev/null
+<html>
+<head>
+
+<style>
+.editing {
+ border: 2px solid red;
+ padding: 12px;
+ font-size: 24px;
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+ for (i = 0; i < 5; i++)
+ moveSelectionForwardByCharacterCommand();
+ typeCharacterCommand();
+}
+
+</script>
+
+<title>Editing Test</title>
+</head>
+<body>
+<div contenteditable id="root" class="editing">
+<div id="test">
+<BLOCKQUOTE>Test</BLOCKQUOTE>
+<BR>
+<BLOCKQUOTE>Test</BLOCKQUOTE>
+</div>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {DIV} at (0,0) size 784x194 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (14,14) size 756x166
+ RenderTable {TABLE} at (0,0) size 64x166 [border: (1px outset #808080)]
+ RenderTableSection {TBODY} at (1,1) size 0x164
+ RenderTableRow {TR} at (0,0) size 0x0
+ RenderTableCell {TD} at (2,2) size 58x54 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
+ RenderText {TEXT} at (13,13) size 32x28
+ text run at (13,13) width 32: "foo"
+ RenderTableRow {TR} at (0,0) size 0x0
+ RenderTableCell {TD} at (2,69) size 58x26 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]
+ RenderTableRow {TR} at (0,0) size 0x0
+ RenderTableCell {TD} at (2,108) size 58x54 [border: (1px inset #808080)] [r=2 c=0 rs=1 cs=1]
+ RenderText {TEXT} at (13,13) size 31x28
+ text run at (13,13) width 31: "bar"
+selection is CARET:
+start: position 0 of child 1 {TEXT} of child 1 {TD} of child 1 {TR} of child 2 {TBODY} of child 1 {TABLE} of child 2 {DIV} of root {DIV}
+upstream: position 0 of child 1 {TD} of child 1 {TR} of child 2 {TBODY} of child 1 {TABLE} of child 2 {DIV} of root {DIV}
+downstream: position 0 of child 1 {TEXT} of child 1 {TD} of child 1 {TR} of child 2 {TBODY} of child 1 {TABLE} of child 2 {DIV} of root {DIV}
--- /dev/null
+<html>
+<head>
+
+<style>
+.editing {
+ border: 2px solid red;
+ padding: 12px;
+ font-size: 24px;
+}
+.cell {
+ padding: 12px;
+ font-size: 24px;
+ height: 48px;
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+ for (i = 0; i < 3; i++) {
+ moveSelectionForwardByLineCommand();
+ }
+}
+
+</script>
+
+<title>Editing Test</title>
+</head>
+<body>
+<div contenteditable id="root" class="editing">
+<div id="test">
+<table border='1'>
+<tr>
+<td class='cell'>foo</td>
+</tr>
+<tr>
+<td class='cell'></td>
+</tr>
+<tr>
+<td class='cell'>bar</td>
+</tr>
+</table>
+</div>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+ RenderInline {SPAN} at (0,0) size 0x0
+ RenderText {TEXT} at (14,14) size 36x28
+ text run at (14,14) width 36: "xxx"
+ RenderInline {B} at (0,0) size 141x28
+ RenderText {TEXT} at (50,14) size 36x28
+ text run at (50,14) width 36: "xxx"
+ RenderInline {I} at (0,0) size 105x28
+ RenderText {TEXT} at (86,14) size 36x28
+ text run at (86,14) width 36: "xxx"
+ RenderInline {SPAN} at (0,0) size 69x28
+ RenderText {TEXT} at (122,14) size 33x28
+ text run at (122,14) width 33: "xxx"
+ RenderInline {SPAN} at (0,0) size 36x28
+ RenderText {TEXT} at (155,14) size 36x28
+ text run at (155,14) width 36: "xxx"
+selection is CARET:
+start: position 3 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of child 2 {I} of child 3 {B} of root {DIV}
+upstream: position 3 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of child 2 {I} of child 3 {B} of root {DIV}
+downstream: position 3 of child 1 {TEXT} of child 2 {SPAN} of child 2 {SPAN} of child 2 {I} of child 3 {B} of root {DIV}
--- /dev/null
+<html>
+<head>
+
+<style>
+.editing {
+ border: 2px solid red;
+ padding: 12px;
+ font-size: 24px;
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+ for (i = 0; i < 3; i++)
+ typeCharacterCommand();
+ boldCommand();
+ for (i = 0; i < 3; i++)
+ typeCharacterCommand();
+ italicCommand();
+ for (i = 0; i < 3; i++)
+ typeCharacterCommand();
+ boldCommand();
+ for (i = 0; i < 3; i++)
+ typeCharacterCommand();
+ italicCommand();
+ for (i = 0; i < 3; i++)
+ typeCharacterCommand();
+}
+
+</script>
+
+<title>Editing Test</title>
+</head>
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test"></span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
+2004-08-31 Ken Kocienda <kocienda@apple.com>
+
+ Reviewed by me
+
+ Added more editing layout tests.
+
+ * layout-tests/editing/deleting/collapse-whitespace-3587601-fix-expected.txt: Added.
+ * layout-tests/editing/deleting/collapse-whitespace-3587601-fix.html: Added.
+ * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt: Added.
+ * layout-tests/editing/deleting/delete-block-merge-contents-001.html: Added.
+ * layout-tests/editing/editing.js: Added some more navigation commands.
+ * layout-tests/editing/inserting/insert-3778059-fix-expected.txt: Added.
+ * layout-tests/editing/inserting/insert-3778059-fix.html: Added.
+ * layout-tests/editing/selection/move-by-line-001-expected.txt: Added.
+ * layout-tests/editing/selection/move-by-line-001.html: Added.
+ * layout-tests/editing/style/typing-style-003-expected.txt: Added.
+ * layout-tests/editing/style/typing-style-003.html: Added.
+
2004-08-31 Ken Kocienda <kocienda@apple.com>
Reviewed by me