Reviewed by me
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Apr 2004 15:21:34 +0000 (15:21 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Apr 2004 15:21:34 +0000 (15:21 +0000)
        Added a new suite of layout tests for editing, all added
        in the new layout-tests/editing subtree.

        * layout-tests/editing/abe.jpg: Added.
        * layout-tests/editing/deleting/delete-block-contents-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-contents-001.html: Added.
        * layout-tests/editing/deleting/delete-block-contents-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-contents-002.html: Added.
        * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-contents-003.html: Added.
        * layout-tests/editing/deleting/delete-br-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-001.html: Added.
        * layout-tests/editing/deleting/delete-br-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-002.html: Added.
        * layout-tests/editing/deleting/delete-br-003-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-003.html: Added.
        * layout-tests/editing/deleting/delete-br-004-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-004.html: Added.
        * layout-tests/editing/deleting/delete-br-005-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-005.html: Added.
        * layout-tests/editing/deleting/delete-br-006-expected.txt: Added.
        * layout-tests/editing/deleting/delete-br-006.html: Added.
        * layout-tests/editing/deleting/delete-character-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-character-001.html: Added.
        * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-contiguous-ws-001.html: Added.
        * layout-tests/editing/deleting/delete-image-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-image-001.html: Added.
        * layout-tests/editing/deleting/delete-image-002-expected.txt: Added.
        * layout-tests/editing/deleting/delete-image-002.html: Added.
        * layout-tests/editing/deleting/delete-image-003-expected.txt: Added.
        * layout-tests/editing/deleting/delete-image-003.html: Added.
        * layout-tests/editing/deleting/delete-leading-ws-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-leading-ws-001.html: Added.
        * layout-tests/editing/deleting/delete-selection-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-selection-001.html: Added.
        * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-trailing-ws-001.html: Added.
        * layout-tests/editing/editing.js: Added.
        * layout-tests/editing/inserting/typing-001-expected.txt: Added.
        * layout-tests/editing/inserting/typing-001.html: Added.
        * layout-tests/editing/inserting/typing-002-expected.txt: Added.
        * layout-tests/editing/inserting/typing-002.html: Added.
        * layout-tests/editing/inserting/typing-around-br-001-expected.txt: Added.
        * layout-tests/editing/inserting/typing-around-br-001.html: Added.
        * layout-tests/editing/inserting/typing-around-image-001-expected.txt: Added.
        * layout-tests/editing/inserting/typing-around-image-001.html: Added.
        * layout-tests/editing/selection/extend-by-character-001-expected.txt: Added.
        * layout-tests/editing/selection/extend-by-character-001.html: Added.
        * layout-tests/editing/selection/extend-by-character-002-expected.txt: Added.
        * layout-tests/editing/selection/extend-by-character-002.html: Added.
        * layout-tests/editing/selection/extend-by-character-003-expected.txt: Added.
        * layout-tests/editing/selection/extend-by-character-003.html: Added.
        * layout-tests/editing/selection/extend-by-character-004-expected.txt: Added.
        * layout-tests/editing/selection/extend-by-character-004.html: Added.
        * layout-tests/editing/selection/extend-by-character-005-expected.txt: Added.
        * layout-tests/editing/selection/extend-by-character-005.html: Added.
        * layout-tests/editing/selection/move-by-character-001-expected.txt: Added.
        * layout-tests/editing/selection/move-by-character-001.html: Added.
        * layout-tests/editing/selection/move-by-character-002-expected.txt: Added.
        * layout-tests/editing/selection/move-by-character-002.html: Added.
        * layout-tests/editing/selection/move-by-character-003-expected.txt: Added.
        * layout-tests/editing/selection/move-by-character-003.html: Added.
        * layout-tests/editing/selection/move-by-character-004-expected.txt: Added.
        * layout-tests/editing/selection/move-by-character-004.html: Added.
        * layout-tests/editing/selection/move-by-character-005-expected.txt: Added.
        * layout-tests/editing/selection/move-by-character-005.html: Added.
        * layout-tests/editing/undo/redo-typing-001-expected.txt: Added.
        * layout-tests/editing/undo/redo-typing-001.html: Added.
        * layout-tests/editing/undo/undo-typing-001-expected.txt: Added.
        * layout-tests/editing/undo/undo-typing-001.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@6315 268f45cc-cd09-0410-ab3c-d52691b4dbfc

69 files changed:
LayoutTests/editing/abe.jpg [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-contents-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-contents-001.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-contents-002-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-contents-002.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-contents-003-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-contents-003.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-001.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-002-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-002.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-003-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-003.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-004-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-004.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-005-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-005.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-006-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-006.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-character-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-character-001.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-contiguous-ws-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-contiguous-ws-001.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-image-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-image-001.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-image-002-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-image-002.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-image-003-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-image-003.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-leading-ws-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-leading-ws-001.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-selection-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-selection-001.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-trailing-ws-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-trailing-ws-001.html [new file with mode: 0644]
LayoutTests/editing/editing.js [new file with mode: 0644]
LayoutTests/editing/inserting/typing-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/typing-001.html [new file with mode: 0644]
LayoutTests/editing/inserting/typing-002-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/typing-002.html [new file with mode: 0644]
LayoutTests/editing/inserting/typing-around-br-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/typing-around-br-001.html [new file with mode: 0644]
LayoutTests/editing/inserting/typing-around-image-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/typing-around-image-001.html [new file with mode: 0644]
LayoutTests/editing/selection/extend-by-character-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/extend-by-character-001.html [new file with mode: 0644]
LayoutTests/editing/selection/extend-by-character-002-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/extend-by-character-002.html [new file with mode: 0644]
LayoutTests/editing/selection/extend-by-character-003-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/extend-by-character-003.html [new file with mode: 0644]
LayoutTests/editing/selection/extend-by-character-004-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/extend-by-character-004.html [new file with mode: 0644]
LayoutTests/editing/selection/extend-by-character-005-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/extend-by-character-005.html [new file with mode: 0644]
LayoutTests/editing/selection/move-by-character-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/move-by-character-001.html [new file with mode: 0644]
LayoutTests/editing/selection/move-by-character-002-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/move-by-character-002.html [new file with mode: 0644]
LayoutTests/editing/selection/move-by-character-003-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/move-by-character-003.html [new file with mode: 0644]
LayoutTests/editing/selection/move-by-character-004-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/move-by-character-004.html [new file with mode: 0644]
LayoutTests/editing/selection/move-by-character-005-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/move-by-character-005.html [new file with mode: 0644]
LayoutTests/editing/undo/redo-typing-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/undo/redo-typing-001.html [new file with mode: 0644]
LayoutTests/editing/undo/undo-typing-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/undo/undo-typing-001.html [new file with mode: 0644]
WebCore/ChangeLog-2005-08-23

diff --git a/LayoutTests/editing/abe.jpg b/LayoutTests/editing/abe.jpg
new file mode 100644 (file)
index 0000000..48d5019
Binary files /dev/null and b/LayoutTests/editing/abe.jpg differ
diff --git a/LayoutTests/editing/deleting/delete-block-contents-001-expected.txt b/LayoutTests/editing/deleting/delete-block-contents-001-expected.txt
new file mode 100644 (file)
index 0000000..9849805
--- /dev/null
@@ -0,0 +1,10 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+selection is CARET:
+start:      position 0 of  of root {DIV}
+upstream:   position 0 of  of root {DIV}
+downstream: position 0 of  of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-block-contents-001.html b/LayoutTests/editing/deleting/delete-block-contents-001.html
new file mode 100644 (file)
index 0000000..1f29e92
--- /dev/null
@@ -0,0 +1,34 @@
+<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() {
+    selectAllCommand();
+    deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">foo   bar             baz</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-block-contents-002-expected.txt b/LayoutTests/editing/deleting/delete-block-contents-002-expected.txt
new file mode 100644 (file)
index 0000000..9849805
--- /dev/null
@@ -0,0 +1,10 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+selection is CARET:
+start:      position 0 of  of root {DIV}
+upstream:   position 0 of  of root {DIV}
+downstream: position 0 of  of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-block-contents-002.html b/LayoutTests/editing/deleting/delete-block-contents-002.html
new file mode 100644 (file)
index 0000000..f6533ec
--- /dev/null
@@ -0,0 +1,36 @@
+<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 < 11; i++) {
+        extendSelectionForwardByCharacterCommand();    
+    }
+    deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">foo   bar             baz</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-block-contents-003-expected.txt b/LayoutTests/editing/deleting/delete-block-contents-003-expected.txt
new file mode 100644 (file)
index 0000000..6f20637
--- /dev/null
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x128
+  RenderBlock {HTML} at (0,0) size 800x128
+    RenderBody {BODY} at (8,8) size 784x112
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 109x28
+          RenderText {TEXT} at (14,14) size 109x28
+            text run at (14,14) width 38: "foo "
+            text run at (52,14) width 37: "bar "
+            text run at (89,14) width 34: "baz"
+        RenderText {TEXT} at (0,0) size 0x0
+      RenderBlock {DIV} at (0,56) size 784x56 [border: (2px solid #FF0000)]
+selection is CARET:
+start:      position 0 of child 3 {DIV} of child 2 {BODY} of child 1 {HTML} of root {}
+upstream:   position 0 of child 3 {DIV} of child 2 {BODY} of child 1 {HTML} of root {}
+downstream: position 0 of child 3 {DIV} of child 2 {BODY} of child 1 {HTML} of root {}
diff --git a/LayoutTests/editing/deleting/delete-block-contents-003.html b/LayoutTests/editing/deleting/delete-block-contents-003.html
new file mode 100644 (file)
index 0000000..a23e394
--- /dev/null
@@ -0,0 +1,39 @@
+<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 < 11; i++) {
+        extendSelectionForwardByCharacterCommand();    
+    }
+    deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span>foo   bar             baz</span>
+</div>
+<div contenteditable id="root" class="editing">
+<span id="test">foo   bar             baz</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-br-001-expected.txt b/LayoutTests/editing/deleting/delete-br-001-expected.txt
new file mode 100644 (file)
index 0000000..12001c6
--- /dev/null
@@ -0,0 +1,18 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 296x28
+          RenderText {TEXT} at (14,14) size 204x28
+            text run at (14,14) width 102: "Fourscore "
+            text run at (116,14) width 41: "and "
+            text run at (157,14) width 61: "seven "
+          RenderText {TEXT} at (218,14) size 92x28
+            text run at (218,14) width 92: "years ago"
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 0 of child 2 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 23 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 0 of child 2 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-br-001.html b/LayoutTests/editing/deleting/delete-br-001.html
new file mode 100644 (file)
index 0000000..f29d5aa
--- /dev/null
@@ -0,0 +1,37 @@
+<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 < 21; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">Fourscore 
+and   seven <br>years ago</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-br-002-expected.txt b/LayoutTests/editing/deleting/delete-br-002-expected.txt
new file mode 100644 (file)
index 0000000..8d58e59
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x128
+  RenderBlock {HTML} at (0,0) size 800x128
+    RenderBody {BODY} at (8,8) size 784x112
+      RenderBlock {DIV} at (0,0) size 628x112 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 204x84
+          RenderText {TEXT} at (14,14) size 204x28
+            text run at (14,14) width 102: "Fourscore "
+            text run at (116,14) width 41: "and "
+            text run at (157,14) width 61: "seven "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderBR {BR} at (14,42) size 0x28
+          RenderText {TEXT} at (14,70) size 92x28
+            text run at (14,70) width 92: "years ago"
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 0 of child 3 {BR} of child 2 {SPAN} of root {DIV}
+upstream:   position 1 of child 2 {BR} of child 2 {SPAN} of root {DIV}
+downstream: position 0 of child 3 {BR} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-br-002.html b/LayoutTests/editing/deleting/delete-br-002.html
new file mode 100644 (file)
index 0000000..c63f997
--- /dev/null
@@ -0,0 +1,44 @@
+<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 < 22; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    deleteCommand();
+    
+    // This should not be necessary, but due to the following bug, the caret
+    // does not repaint in the proper position. Changing the size of the DIV
+    // is a workaround. The bug:
+    // <rdar://problem/3608445>: Garbage characters rendered after doing delete. Resize makes them go away.
+    changeRootSize();
+    
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">Fourscore 
+and   seven <br><br><br>years ago</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-br-003-expected.txt b/LayoutTests/editing/deleting/delete-br-003-expected.txt
new file mode 100644 (file)
index 0000000..c65dd53
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x128
+  RenderBlock {HTML} at (0,0) size 800x128
+    RenderBody {BODY} at (8,8) size 784x112
+      RenderBlock {DIV} at (0,0) size 628x112 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 204x84
+          RenderText {TEXT} at (14,14) size 204x28
+            text run at (14,14) width 102: "Fourscore "
+            text run at (116,14) width 41: "and "
+            text run at (157,14) width 61: "seven "
+          RenderBR {BR} at (14,42) size 0x28
+          RenderBR {BR} at (14,42) size 0x28
+          RenderText {TEXT} at (14,70) size 92x28
+            text run at (14,70) width 92: "years ago"
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 0 of child 2 {BR} of child 2 {SPAN} of root {DIV}
+upstream:   position 23 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 0 of child 2 {BR} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-br-003.html b/LayoutTests/editing/deleting/delete-br-003.html
new file mode 100644 (file)
index 0000000..3e594e4
--- /dev/null
@@ -0,0 +1,44 @@
+<html> 
+<head>
+
+<style>
+.editing { 
+    border: 2px solid red; 
+    padding: 12px; 
+    font-size: 24px; 
+    width: 599px; 
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+    for (i = 0; i < 21; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    deleteCommand();
+    
+    // This should not be necessary, but due to the following bug, the caret
+    // does not repaint in the proper position. Changing the size of the DIV
+    // is a workaround. The bug:
+    // <rdar://problem/3608445>: Garbage characters rendered after doing delete. Resize makes them go away.
+    changeRootSize();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">Fourscore 
+and   seven <br><br><br>years ago</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-br-004-expected.txt b/LayoutTests/editing/deleting/delete-br-004-expected.txt
new file mode 100644 (file)
index 0000000..b28eb7f
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x128
+  RenderBlock {HTML} at (0,0) size 800x128
+    RenderBody {BODY} at (8,8) size 784x112
+      RenderBlock {DIV} at (0,0) size 628x112 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 204x84
+          RenderText {TEXT} at (14,14) size 204x28
+            text run at (14,14) width 102: "Fourscore "
+            text run at (116,14) width 41: "and "
+            text run at (157,14) width 61: "seven "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderBR {BR} at (14,42) size 0x28
+          RenderText {TEXT} at (14,70) size 92x28
+            text run at (14,70) width 92: "years ago"
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 0 of child 4 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 1 of child 3 {BR} of child 2 {SPAN} of root {DIV}
+downstream: position 0 of child 4 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-br-004.html b/LayoutTests/editing/deleting/delete-br-004.html
new file mode 100644 (file)
index 0000000..3d1ea38
--- /dev/null
@@ -0,0 +1,44 @@
+<html> 
+<head>
+
+<style>
+.editing { 
+    border: 2px solid red; 
+    padding: 12px; 
+    font-size: 24px; 
+    width: 599px; 
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+    for (i = 0; i < 23; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    deleteCommand();
+    
+    // This should not be necessary, but due to the following bug, the caret
+    // does not repaint in the proper position. Changing the size of the DIV
+    // is a workaround. The bug:
+    // <rdar://problem/3608445>: Garbage characters rendered after doing delete. Resize makes them go away.
+    changeRootSize();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">Fourscore 
+and   seven <br><br><br>years ago</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-br-005-expected.txt b/LayoutTests/editing/deleting/delete-br-005-expected.txt
new file mode 100644 (file)
index 0000000..8865591
--- /dev/null
@@ -0,0 +1,19 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x100
+  RenderBlock {HTML} at (0,0) size 800x100
+    RenderBody {BODY} at (8,8) size 784x84
+      RenderBlock {DIV} at (0,0) size 628x84 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 204x56
+          RenderText {TEXT} at (14,14) size 204x28
+            text run at (14,14) width 102: "Fourscore "
+            text run at (116,14) width 41: "and "
+            text run at (157,14) width 61: "seven "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,42) size 92x28
+            text run at (14,42) width 92: "years ago"
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 0 of child 3 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 1 of child 2 {BR} of child 2 {SPAN} of root {DIV}
+downstream: position 0 of child 3 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-br-005.html b/LayoutTests/editing/deleting/delete-br-005.html
new file mode 100644 (file)
index 0000000..245ed31
--- /dev/null
@@ -0,0 +1,45 @@
+<html> 
+<head>
+
+<style>
+.editing { 
+    border: 2px solid red; 
+    padding: 12px; 
+    font-size: 24px; 
+    width: 599px; 
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+    for (i = 0; i < 23; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    deleteCommand();
+    deleteCommand();
+    
+    // This should not be necessary, but due to the following bug, the caret
+    // does not repaint in the proper position. Changing the size of the DIV
+    // is a workaround. The bug:
+    // <rdar://problem/3608445>: Garbage characters rendered after doing delete. Resize makes them go away.
+    changeRootSize();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">Fourscore 
+and   seven <br><br><br>years ago</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-br-006-expected.txt b/LayoutTests/editing/deleting/delete-br-006-expected.txt
new file mode 100644 (file)
index 0000000..8a40cca
--- /dev/null
@@ -0,0 +1,18 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 628x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 296x28
+          RenderText {TEXT} at (14,14) size 204x28
+            text run at (14,14) width 102: "Fourscore "
+            text run at (116,14) width 41: "and "
+            text run at (157,14) width 61: "seven "
+          RenderText {TEXT} at (218,14) size 92x28
+            text run at (218,14) width 92: "years ago"
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 0 of child 2 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 23 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 0 of child 2 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-br-006.html b/LayoutTests/editing/deleting/delete-br-006.html
new file mode 100644 (file)
index 0000000..e9940b7
--- /dev/null
@@ -0,0 +1,46 @@
+<html> 
+<head>
+
+<style>
+.editing { 
+    border: 2px solid red; 
+    padding: 12px; 
+    font-size: 24px; 
+    width: 599px; 
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+    for (i = 0; i < 23; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    deleteCommand();
+    deleteCommand();
+    deleteCommand();
+    
+    // This should not be necessary, but due to the following bug, the caret
+    // does not repaint in the proper position. Changing the size of the DIV
+    // is a workaround. The bug:
+    // <rdar://problem/3608445>: Garbage characters rendered after doing delete. Resize makes them go away.
+    changeRootSize();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">Fourscore 
+and   seven <br><br><br>years ago</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-character-001-expected.txt b/LayoutTests/editing/deleting/delete-character-001-expected.txt
new file mode 100644 (file)
index 0000000..d4d3d2e
--- /dev/null
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 97x28
+          RenderText {TEXT} at (14,14) size 97x28
+            text run at (14,14) width 26: "fo "
+            text run at (40,14) width 37: "bar "
+            text run at (77,14) width 34: "baz"
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 1 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 1 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 1 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-character-001.html b/LayoutTests/editing/deleting/delete-character-001.html
new file mode 100644 (file)
index 0000000..6776857
--- /dev/null
@@ -0,0 +1,36 @@
+<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 < 2; i++) {
+        moveSelectionForwardByCharacterCommand();    
+    }
+    deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">foo   bar    baz</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-contiguous-ws-001-expected.txt b/LayoutTests/editing/deleting/delete-contiguous-ws-001-expected.txt
new file mode 100644 (file)
index 0000000..7bc128e
--- /dev/null
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 78x28
+          RenderText {TEXT} at (14,14) size 78x28
+            text run at (14,14) width 44: "foo  "
+            text run at (58,14) width 34: "baz"
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 4 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 4 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 4 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-contiguous-ws-001.html b/LayoutTests/editing/deleting/delete-contiguous-ws-001.html
new file mode 100644 (file)
index 0000000..904a7cf
--- /dev/null
@@ -0,0 +1,41 @@
+<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 < 4; i++) {
+        moveSelectionForwardByCharacterCommand();    
+    }
+    for (i = 0; i < 3; i++) {
+        extendSelectionForwardByCharacterCommand();    
+    }
+    deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">foo    bar   
+
+baz</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-image-001-expected.txt b/LayoutTests/editing/deleting/delete-image-001-expected.txt
new file mode 100644 (file)
index 0000000..141cbf8
--- /dev/null
@@ -0,0 +1,23 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x262
+  RenderBlock {HTML} at (0,0) size 800x262
+    RenderBody {BODY} at (8,8) size 784x246
+      RenderBlock {DIV} at (0,0) size 784x246 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 204x137
+          RenderText {TEXT} at (14,95) size 11x28
+            text run at (14,95) width 11: "a"
+          RenderImage {IMG} at (25,14) size 76x103
+          RenderText {TEXT} at (101,95) size 6x28
+            text run at (101,95) width 6: " "
+          RenderText {TEXT} at (107,95) size 111x28
+            text run at (107,95) width 111: " conceived "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,204) size 61x28
+            text run at (14,204) width 61: "nation"
+          RenderImage {IMG} at (75,123) size 76x103
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 1 of child 3 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 1 of child 3 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 0 of child 4 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-image-001.html b/LayoutTests/editing/deleting/delete-image-001.html
new file mode 100644 (file)
index 0000000..8dc9715
--- /dev/null
@@ -0,0 +1,37 @@
+<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 < 4; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">a<img src="../abe.jpg"> <img src="../abe.jpg"> conceived
+<br>nation<img src="../abe.jpg"></span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-image-002-expected.txt b/LayoutTests/editing/deleting/delete-image-002-expected.txt
new file mode 100644 (file)
index 0000000..4f95135
--- /dev/null
@@ -0,0 +1,29 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x290
+  RenderBlock {HTML} at (0,0) size 800x290
+    RenderBody {BODY} at (8,8) size 784x274
+      RenderBlock {DIV} at (0,0) size 784x274 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 254x246
+          RenderText {TEXT} at (14,14) size 11x28
+            text run at (14,14) width 11: "a"
+          RenderText {TEXT} at (25,14) size 46x28
+            text run at (25,14) width 46: "new "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,123) size 67x28
+            text run at (14,123) width 67: "nation "
+          RenderInline {I} at (0,0) size 0x0
+            RenderText {TEXT} at (0,0) size 0x0
+          RenderText {TEXT} at (0,0) size 0x0
+          RenderImage {IMG} at (81,42) size 76x103
+          RenderText {TEXT} at (157,123) size 111x28
+            text run at (157,123) width 111: " conceived "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,232) size 61x28
+            text run at (14,232) width 61: "nation"
+          RenderImage {IMG} at (75,151) size 76x103
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 1 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 1 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 0 of child 2 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-image-002.html b/LayoutTests/editing/deleting/delete-image-002.html
new file mode 100644 (file)
index 0000000..bbeb429
--- /dev/null
@@ -0,0 +1,38 @@
+<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 < 2; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">a<img src="../abe.jpg">new 
+<br>nation <i>  </i> <img src="../abe.jpg"> conceived
+<br>nation<img src="../abe.jpg"></span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-image-003-expected.txt b/LayoutTests/editing/deleting/delete-image-003-expected.txt
new file mode 100644 (file)
index 0000000..584a054
--- /dev/null
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 85x28
+          RenderText {TEXT} at (14,14) size 11x28
+            text run at (14,14) width 11: "a"
+          RenderText {TEXT} at (25,14) size 74x28
+            text run at (25,14) width 74: " lincoln"
+selection is CARET:
+start:      position 1 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 1 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 0 of child 2 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-image-003.html b/LayoutTests/editing/deleting/delete-image-003.html
new file mode 100644 (file)
index 0000000..dc15f08
--- /dev/null
@@ -0,0 +1,36 @@
+<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() {
+    moveSelectionForwardByCharacterCommand();
+    extendSelectionForwardByCharacterCommand();
+    extendSelectionForwardByCharacterCommand();
+    deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">a<img src="../abe.jpg"><img src="../abe.jpg"> lincoln
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-leading-ws-001-expected.txt b/LayoutTests/editing/deleting/delete-leading-ws-001-expected.txt
new file mode 100644 (file)
index 0000000..d76777f
--- /dev/null
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 14x28
+          RenderText {TEXT} at (14,14) size 14x28
+            text run at (14,14) width 14: "f "
+selection is CARET:
+start:      position 2 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 2 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 2 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-leading-ws-001.html b/LayoutTests/editing/deleting/delete-leading-ws-001.html
new file mode 100644 (file)
index 0000000..a78d29f
--- /dev/null
@@ -0,0 +1,39 @@
+<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 < 2; i++) {
+        moveSelectionForwardByCharacterCommand();    
+    }
+    for (i = 0; i < 4; i++) {
+        extendSelectionForwardByCharacterCommand();    
+    }
+    deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">f   baz</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-selection-001-expected.txt b/LayoutTests/editing/deleting/delete-selection-001-expected.txt
new file mode 100644 (file)
index 0000000..4f53612
--- /dev/null
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 77x28
+          RenderText {TEXT} at (14,14) size 77x28
+            text run at (14,14) width 43: " bar "
+            text run at (57,14) width 34: "baz"
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 0 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
+upstream:   position 0 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
+downstream: position 0 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-selection-001.html b/LayoutTests/editing/deleting/delete-selection-001.html
new file mode 100644 (file)
index 0000000..03b8a4f
--- /dev/null
@@ -0,0 +1,36 @@
+<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++) {
+        extendSelectionForwardByCharacterCommand();    
+    }
+    deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">foo   bar    baz</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/deleting/delete-trailing-ws-001-expected.txt b/LayoutTests/editing/deleting/delete-trailing-ws-001-expected.txt
new file mode 100644 (file)
index 0000000..4f53612
--- /dev/null
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 77x28
+          RenderText {TEXT} at (14,14) size 77x28
+            text run at (14,14) width 43: " bar "
+            text run at (57,14) width 34: "baz"
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 0 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
+upstream:   position 0 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
+downstream: position 0 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-trailing-ws-001.html b/LayoutTests/editing/deleting/delete-trailing-ws-001.html
new file mode 100644 (file)
index 0000000..03b8a4f
--- /dev/null
@@ -0,0 +1,36 @@
+<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++) {
+        extendSelectionForwardByCharacterCommand();    
+    }
+    deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">foo   bar    baz</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/editing.js b/LayoutTests/editing/editing.js
new file mode 100644 (file)
index 0000000..43e9284
--- /dev/null
@@ -0,0 +1,169 @@
+//-------------------------------------------------------------------------------------------------------
+// Java script library to run editing layout tests
+
+var commandCount = 1;
+var commandDelay = window.location.search.substring(1);
+if (commandDelay == '')
+    commandDelay = 0;
+var selection = window.getSelection();
+
+//-------------------------------------------------------------------------------------------------------
+
+function execMoveSelectionForwardByCharacterCommand() {
+    selection.modify("move", "forward", "character");
+}
+function moveSelectionForwardByCharacterCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execMoveSelectionForwardByCharacterCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execMoveSelectionForwardByCharacterCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function execExtendSelectionForwardByCharacterCommand() {
+    selection.modify("extend", "forward", "character");
+}
+function extendSelectionForwardByCharacterCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execExtendSelectionForwardByCharacterCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execExtendSelectionForwardByCharacterCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function execMoveSelectionBackwardByCharacterCommand() {
+    selection.modify("move", "backward", "character");
+}
+function moveSelectionBackwardByCharacterCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execMoveSelectionBackwardByCharacterCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execMoveSelectionBackwardByCharacterCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function execExtendSelectionBackwardByCharacterCommand() {
+    selection.modify("extend", "backward", "character");
+}
+function extendSelectionBackwardByCharacterCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execExtendSelectionBackwardByCharacterCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execExtendSelectionBackwardByCharacterCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function execTypeCharacterCommand() {
+    document.execCommand("InsertText", false, "x");
+}
+function typeCharacterCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execTypeCharacterCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execTypeCharacterCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function execSelectAllCommand() {
+    document.execCommand("SelectAll");
+}
+function selectAllCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execSelectAllCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execSelectAllCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function execUndoCommand() {
+    document.execCommand("Undo");
+}
+function undoCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execUndoCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execUndoCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function execRedoCommand() {
+    document.execCommand("Redo");
+}
+function redoCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execRedoCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execRedoCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function execChangeRootSize() {
+    document.getElementById("root").style.width = "600px";
+}
+function changeRootSize() {
+    if (commandDelay > 0) {
+        window.setTimeout(execChangeRootSize, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execChangeRootSize();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function execDeleteCommand() {
+    document.execCommand("Delete");
+}
+function deleteCommand() {
+    if (commandDelay > 0) {
+        window.setTimeout(execDeleteCommand, commandCount * commandDelay);
+        commandCount++;
+    }
+    else {
+        execDeleteCommand();
+    }
+}
+
+//-------------------------------------------------------------------------------------------------------
+
+function runEditingTest() {
+    var elem = document.getElementById("test");
+    var selection = window.getSelection();
+    selection.setPosition(elem, 0);
+    editingTest();
+}
+
+//-------------------------------------------------------------------------------------------------------
diff --git a/LayoutTests/editing/inserting/typing-001-expected.txt b/LayoutTests/editing/inserting/typing-001-expected.txt
new file mode 100644 (file)
index 0000000..0bcd397
--- /dev/null
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 176x28
+          RenderText {TEXT} at (14,14) size 176x28
+            text run at (14,14) width 176: "xxxXXxxxXXxxx"
+selection is CARET:
+start:      position 13 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
+upstream:   position 13 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
+downstream: position 13 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/inserting/typing-001.html b/LayoutTests/editing/inserting/typing-001.html
new file mode 100644 (file)
index 0000000..a56ea04
--- /dev/null
@@ -0,0 +1,47 @@
+<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();
+    }
+    for (i = 0; i < 2; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    for (i = 0; i < 3; i++) {
+        typeCharacterCommand();
+    }
+    for (i = 0; i < 2; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    for (i = 0; i < 3; i++) {
+        typeCharacterCommand();
+    }
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">XXXX</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/inserting/typing-002-expected.txt b/LayoutTests/editing/inserting/typing-002-expected.txt
new file mode 100644 (file)
index 0000000..7919da1
--- /dev/null
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 112x28
+          RenderText {TEXT} at (14,14) size 79x28
+            text run at (14,14) width 79: "Foo xxx"
+          RenderInline {I} at (0,0) size 33x28
+            RenderText {TEXT} at (93,14) size 33x28
+              text run at (93,14) width 33: "bar"
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 7 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 7 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 0 of child 1 {TEXT} of child 2 {I} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/inserting/typing-002.html b/LayoutTests/editing/inserting/typing-002.html
new file mode 100644 (file)
index 0000000..94af2a5
--- /dev/null
@@ -0,0 +1,42 @@
+<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 moveNSpacesAndType(n) {
+    for (i = 0; i < n; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    for (i = 0; i < 3; i++) {
+        typeCharacterCommand();
+    }
+}
+
+function editingTest() {
+    moveNSpacesAndType(4);
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">Foo    <i>  bar</i></span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/inserting/typing-around-br-001-expected.txt b/LayoutTests/editing/inserting/typing-around-br-001-expected.txt
new file mode 100644 (file)
index 0000000..55eb5ed
--- /dev/null
@@ -0,0 +1,34 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x268
+  RenderBlock {HTML} at (0,0) size 800x268
+    RenderBody {BODY} at (8,8) size 784x252
+      RenderBlock {DIV} at (0,0) size 784x252 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 70x224
+          RenderText {TEXT} at (14,14) size 70x28
+            text run at (14,14) width 70: "XXxxx"
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,42) size 70x28
+            text run at (14,42) width 70: "XXxxx"
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,70) size 36x28
+            text run at (14,70) width 36: "xxx"
+          RenderBR {BR} at (14,70) size 0x28
+          RenderText {TEXT} at (14,98) size 70x28
+            text run at (14,98) width 70: "XXxxx"
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,126) size 36x28
+            text run at (14,126) width 36: "xxx"
+          RenderBR {BR} at (14,126) size 0x28
+          RenderText {TEXT} at (14,154) size 36x28
+            text run at (14,154) width 36: "xxx"
+          RenderBR {BR} at (14,154) size 0x28
+          RenderText {TEXT} at (14,182) size 36x28
+            text run at (14,182) width 36: "xxx"
+          RenderBR {BR} at (14,182) size 0x28
+          RenderText {TEXT} at (14,210) size 70x28
+            text run at (14,210) width 70: "XXxxx"
+selection is CARET:
+start:      position 5 of child 15 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 5 of child 15 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 5 of child 15 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/inserting/typing-around-br-001.html b/LayoutTests/editing/inserting/typing-around-br-001.html
new file mode 100644 (file)
index 0000000..bba7f54
--- /dev/null
@@ -0,0 +1,49 @@
+<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 moveNSpacesAndType(n) {
+    for (i = 0; i < n; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    for (i = 0; i < 3; i++) {
+        typeCharacterCommand();
+    }
+}
+
+function editingTest() {
+    moveNSpacesAndType(2);
+    moveNSpacesAndType(3);
+    moveNSpacesAndType(1);
+    moveNSpacesAndType(3);
+    moveNSpacesAndType(1);
+    moveNSpacesAndType(1);
+    moveNSpacesAndType(1);
+    moveNSpacesAndType(3);
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">XX<br>XX<br><br>XX<br><br><br><br>XX</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/inserting/typing-around-image-001-expected.txt b/LayoutTests/editing/inserting/typing-around-image-001-expected.txt
new file mode 100644 (file)
index 0000000..f725ce4
--- /dev/null
@@ -0,0 +1,24 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x153
+  RenderBlock {HTML} at (0,0) size 800x153
+    RenderBody {BODY} at (8,8) size 784x137
+      RenderBlock {DIV} at (0,0) size 784x137 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 390x28
+          RenderText {TEXT} at (14,95) size 12x28
+            text run at (14,95) width 12: "x"
+          RenderImage {IMG} at (26,14) size 76x103
+          RenderText {TEXT} at (102,95) size 36x28
+            text run at (102,95) width 36: "xxx"
+          RenderImage {IMG} at (138,14) size 76x103
+          RenderText {TEXT} at (214,95) size 36x28
+            text run at (214,95) width 36: "xxx"
+          RenderText {TEXT} at (250,95) size 42x28
+            text run at (250,95) width 42: " xxx"
+          RenderImage {IMG} at (292,14) size 76x103
+          RenderText {TEXT} at (368,95) size 36x28
+            text run at (368,95) width 36: "xxx"
+selection is CARET:
+start:      position 3 of child 8 {TEXT} of child 1 {SPAN} of root {DIV}
+upstream:   position 3 of child 8 {TEXT} of child 1 {SPAN} of root {DIV}
+downstream: position 3 of child 8 {TEXT} of child 1 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/inserting/typing-around-image-001.html b/LayoutTests/editing/inserting/typing-around-image-001.html
new file mode 100644 (file)
index 0000000..98d0896
--- /dev/null
@@ -0,0 +1,46 @@
+<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 moveNSpacesAndType(n) {
+    for (i = 0; i < n; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    for (i = 0; i < 3; i++) {
+        typeCharacterCommand();
+    }
+}
+
+function editingTest() {
+    typeCharacterCommand();
+    moveNSpacesAndType(1);
+    moveNSpacesAndType(1);
+    moveNSpacesAndType(1);
+    moveNSpacesAndType(1);
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test"><img src="../abe.jpg"><img src="../abe.jpg"> <img src="../abe.jpg"></span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/selection/extend-by-character-001-expected.txt b/LayoutTests/editing/selection/extend-by-character-001-expected.txt
new file mode 100644 (file)
index 0000000..8dd38e4
--- /dev/null
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 115x28
+          RenderText {TEXT} at (14,14) size 115x28
+            text run at (14,14) width 14: "f "
+            text run at (28,14) width 30: "oo "
+            text run at (58,14) width 37: "bar "
+            text run at (95,14) width 34: "baz"
+        RenderText {TEXT} at (0,0) size 0x0
+selection is RANGE:
+start:      position 2 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 2 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 5 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+end:        position 14 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 14 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 17 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/selection/extend-by-character-001.html b/LayoutTests/editing/selection/extend-by-character-001.html
new file mode 100644 (file)
index 0000000..63db1c0
--- /dev/null
@@ -0,0 +1,37 @@
+<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() {
+    moveSelectionForwardByCharacterCommand();
+    moveSelectionForwardByCharacterCommand();
+    for (i = 0; i < 7; i++) {
+        extendSelectionForwardByCharacterCommand();
+    }
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">f    oo   bar    baz</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/selection/extend-by-character-002-expected.txt b/LayoutTests/editing/selection/extend-by-character-002-expected.txt
new file mode 100644 (file)
index 0000000..993861b
--- /dev/null
@@ -0,0 +1,34 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x371
+  RenderBlock {HTML} at (0,0) size 800x371
+    RenderBody {BODY} at (8,8) size 784x355
+      RenderBlock {DIV} at (0,0) size 784x355 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 254x246
+          RenderText {TEXT} at (14,95) size 11x28
+            text run at (14,95) width 11: "a"
+          RenderImage {IMG} at (25,14) size 76x103
+          RenderText {TEXT} at (101,95) size 46x28
+            text run at (101,95) width 46: "new "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,204) size 67x28
+            text run at (14,204) width 67: "nation "
+          RenderInline {I} at (0,0) size 0x0
+            RenderText {TEXT} at (0,0) size 0x0
+          RenderText {TEXT} at (0,0) size 0x0
+          RenderImage {IMG} at (81,123) size 76x103
+          RenderText {TEXT} at (157,204) size 111x28
+            text run at (157,204) width 6: " "
+            text run at (163,204) width 105: "conceived "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,313) size 61x28
+            text run at (14,313) width 61: "nation"
+          RenderImage {IMG} at (75,232) size 76x103
+        RenderText {TEXT} at (0,0) size 0x0
+selection is RANGE:
+start:      position 0 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 0 of child 1 {TEXT} of root {DIV}
+downstream: position 0 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+end:        position 6 of child 11 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 6 of child 11 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 0 of child 12 {IMG} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/selection/extend-by-character-002.html b/LayoutTests/editing/selection/extend-by-character-002.html
new file mode 100644 (file)
index 0000000..9768d8a
--- /dev/null
@@ -0,0 +1,40 @@
+<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 < 33; i++) {
+        extendSelectionForwardByCharacterCommand();
+    }
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">a<img src="../abe.jpg">new      
+<br>nation    <i>  </i> <img src="../abe.jpg">     
+
+
+conceived
+<br>nation<img src="../abe.jpg"></span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/selection/extend-by-character-003-expected.txt b/LayoutTests/editing/selection/extend-by-character-003-expected.txt
new file mode 100644 (file)
index 0000000..7ccd6d8
--- /dev/null
@@ -0,0 +1,32 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x128
+  RenderBlock {HTML} at (0,0) size 800x128
+    RenderBody {BODY} at (8,8) size 784x112
+      RenderBlock {DIV} at (0,0) size 784x112 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 659x84
+          RenderInline {I} at (0,0) size 117x28
+            RenderText {TEXT} at (14,14) size 117x28
+              text run at (14,14) width 21: "F "
+              text run at (35,14) width 96: "and seven"
+          RenderText {TEXT} at (131,14) size 63x28
+            text run at (131,14) width 63: " years "
+          RenderInline {B} at (0,0) size 27x28
+            RenderText {TEXT} at (194,14) size 27x28
+              text run at (194,14) width 27: "as "
+          RenderText {TEXT} at (221,14) size 659x56
+            text run at (221,14) width 110: "our fathers "
+            text run at (331,14) width 342: "f upon this continent, a new nation,"
+            text run at (14,42) width 232: "conceived    in Liberty, "
+            text run at (246,42) width 392: "and dedicated to the proposition that all "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,70) size 220x28
+            text run at (14,70) width 220: "men are created equal."
+        RenderText {TEXT} at (0,0) size 0x0
+selection is RANGE:
+start:      position 2 of child 1 {TEXT} of child 1 {I} of child 2 {SPAN} of root {DIV}
+upstream:   position 2 of child 1 {TEXT} of child 1 {I} of child 2 {SPAN} of root {DIV}
+downstream: position 5 of child 1 {TEXT} of child 1 {I} of child 2 {SPAN} of root {DIV}
+end:        position 21 of child 6 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 21 of child 6 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 21 of child 6 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/selection/extend-by-character-003.html b/LayoutTests/editing/selection/extend-by-character-003.html
new file mode 100644 (file)
index 0000000..9e43e1d
--- /dev/null
@@ -0,0 +1,40 @@
+<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() {
+    moveSelectionForwardByCharacterCommand();
+    moveSelectionForwardByCharacterCommand();
+    for (i = 0; i < 157; i++) {
+        extendSelectionForwardByCharacterCommand();
+    }
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test"><i>F    and seven</i> years <b>  as </b>our fathers  f upon this
+continent, a new nation, conceived &nbsp;&nbsp; in Liberty,                 and dedicated to the
+proposition that all 
+<br>men are created equal.</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/selection/extend-by-character-004-expected.txt b/LayoutTests/editing/selection/extend-by-character-004-expected.txt
new file mode 100644 (file)
index 0000000..3ac25b4
--- /dev/null
@@ -0,0 +1,33 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x371
+  RenderBlock {HTML} at (0,0) size 800x371
+    RenderBody {BODY} at (8,8) size 784x355
+      RenderBlock {DIV} at (0,0) size 784x355 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 254x246
+          RenderText {TEXT} at (14,95) size 11x28
+            text run at (14,95) width 11: "a"
+          RenderImage {IMG} at (25,14) size 76x103
+          RenderText {TEXT} at (101,95) size 46x28
+            text run at (101,95) width 46: "new "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,204) size 67x28
+            text run at (14,204) width 67: "nation "
+          RenderInline {I} at (0,0) size 0x0
+            RenderText {TEXT} at (0,0) size 0x0
+          RenderText {TEXT} at (0,0) size 0x0
+          RenderImage {IMG} at (81,123) size 76x103
+          RenderText {TEXT} at (157,204) size 111x28
+            text run at (157,204) width 111: " conceived "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,313) size 61x28
+            text run at (14,313) width 61: "nation"
+          RenderImage {IMG} at (75,232) size 76x103
+        RenderText {TEXT} at (0,0) size 0x0
+selection is RANGE:
+start:      position 0 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 0 of child 1 {TEXT} of root {DIV}
+downstream: position 0 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+end:        position 1 of child 3 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 1 of child 3 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 1 of child 3 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/selection/extend-by-character-004.html b/LayoutTests/editing/selection/extend-by-character-004.html
new file mode 100644 (file)
index 0000000..7c63a07
--- /dev/null
@@ -0,0 +1,40 @@
+<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 < 33; i++) {
+        extendSelectionForwardByCharacterCommand();
+    }
+    for (i = 0; i < 30; i++) {
+        extendSelectionBackwardByCharacterCommand();
+    }
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">a<img src="../abe.jpg">new 
+<br>nation <i>  </i> <img src="../abe.jpg"> conceived
+<br>nation<img src="../abe.jpg"></span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/selection/extend-by-character-005-expected.txt b/LayoutTests/editing/selection/extend-by-character-005-expected.txt
new file mode 100644 (file)
index 0000000..a6701d2
--- /dev/null
@@ -0,0 +1,32 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x128
+  RenderBlock {HTML} at (0,0) size 800x128
+    RenderBody {BODY} at (8,8) size 784x112
+      RenderBlock {DIV} at (0,0) size 784x112 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 659x84
+          RenderInline {I} at (0,0) size 117x28
+            RenderText {TEXT} at (14,14) size 117x28
+              text run at (14,14) width 21: "F "
+              text run at (35,14) width 96: "and seven"
+          RenderText {TEXT} at (131,14) size 63x28
+            text run at (131,14) width 63: " years "
+          RenderInline {B} at (0,0) size 27x28
+            RenderText {TEXT} at (194,14) size 27x28
+              text run at (194,14) width 27: "as "
+          RenderText {TEXT} at (221,14) size 659x56
+            text run at (221,14) width 110: "our fathers "
+            text run at (331,14) width 342: "f upon this continent, a new nation,"
+            text run at (14,42) width 232: "conceived    in Liberty, "
+            text run at (246,42) width 392: "and dedicated to the proposition that all "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,70) size 220x28
+            text run at (14,70) width 220: "men are created equal."
+        RenderText {TEXT} at (0,0) size 0x0
+selection is RANGE:
+start:      position 0 of child 1 {TEXT} of child 1 {I} of child 2 {SPAN} of root {DIV}
+upstream:   position 0 of child 1 {TEXT} of root {DIV}
+downstream: position 0 of child 1 {TEXT} of child 1 {I} of child 2 {SPAN} of root {DIV}
+end:        position 1 of child 1 {TEXT} of child 1 {I} of child 2 {SPAN} of root {DIV}
+upstream:   position 1 of child 1 {TEXT} of child 1 {I} of child 2 {SPAN} of root {DIV}
+downstream: position 1 of child 1 {TEXT} of child 1 {I} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/selection/extend-by-character-005.html b/LayoutTests/editing/selection/extend-by-character-005.html
new file mode 100644 (file)
index 0000000..4b12949
--- /dev/null
@@ -0,0 +1,41 @@
+<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 < 159; i++) {
+        extendSelectionForwardByCharacterCommand();
+    }
+    for (i = 0; i < 158; i++) {
+        extendSelectionBackwardByCharacterCommand();
+    }
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test"><i>F    and seven</i> years <b>  as </b>our fathers  f upon this
+continent, a new nation, conceived &nbsp;&nbsp; in Liberty,                 and dedicated to the
+proposition that all 
+<br>men are created equal.</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/selection/move-by-character-001-expected.txt b/LayoutTests/editing/selection/move-by-character-001-expected.txt
new file mode 100644 (file)
index 0000000..d1df4fa
--- /dev/null
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 109x28
+          RenderText {TEXT} at (14,14) size 109x28
+            text run at (14,14) width 38: "foo "
+            text run at (52,14) width 37: "bar "
+            text run at (89,14) width 34: "baz"
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 16 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 16 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 1 of child 3 {TEXT} of root {DIV}
diff --git a/LayoutTests/editing/selection/move-by-character-001.html b/LayoutTests/editing/selection/move-by-character-001.html
new file mode 100644 (file)
index 0000000..52fca9f
--- /dev/null
@@ -0,0 +1,35 @@
+<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 < 11; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">foo   bar    baz</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/selection/move-by-character-002-expected.txt b/LayoutTests/editing/selection/move-by-character-002-expected.txt
new file mode 100644 (file)
index 0000000..c95a720
--- /dev/null
@@ -0,0 +1,30 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x371
+  RenderBlock {HTML} at (0,0) size 800x371
+    RenderBody {BODY} at (8,8) size 784x355
+      RenderBlock {DIV} at (0,0) size 784x355 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 254x246
+          RenderText {TEXT} at (14,95) size 11x28
+            text run at (14,95) width 11: "a"
+          RenderImage {IMG} at (25,14) size 76x103
+          RenderText {TEXT} at (101,95) size 46x28
+            text run at (101,95) width 46: "new "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,204) size 67x28
+            text run at (14,204) width 67: "nation "
+          RenderInline {I} at (0,0) size 0x0
+            RenderText {TEXT} at (0,0) size 0x0
+          RenderText {TEXT} at (0,0) size 0x0
+          RenderImage {IMG} at (81,123) size 76x103
+          RenderText {TEXT} at (157,204) size 111x28
+            text run at (157,204) width 111: " conceived "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,313) size 61x28
+            text run at (14,313) width 61: "nation"
+          RenderImage {IMG} at (75,232) size 76x103
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 6 of child 11 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 6 of child 11 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 0 of child 12 {IMG} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/selection/move-by-character-002.html b/LayoutTests/editing/selection/move-by-character-002.html
new file mode 100644 (file)
index 0000000..e6cbc1c
--- /dev/null
@@ -0,0 +1,37 @@
+<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 < 33; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">a<img src="../abe.jpg">new 
+<br>nation <i>  </i> <img src="../abe.jpg"> conceived
+<br>nation<img src="../abe.jpg"></span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/selection/move-by-character-003-expected.txt b/LayoutTests/editing/selection/move-by-character-003-expected.txt
new file mode 100644 (file)
index 0000000..c94149f
--- /dev/null
@@ -0,0 +1,29 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x128
+  RenderBlock {HTML} at (0,0) size 800x128
+    RenderBody {BODY} at (8,8) size 784x112
+      RenderBlock {DIV} at (0,0) size 784x112 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 659x84
+          RenderInline {I} at (0,0) size 117x28
+            RenderText {TEXT} at (14,14) size 117x28
+              text run at (14,14) width 21: "F "
+              text run at (35,14) width 96: "and seven"
+          RenderText {TEXT} at (131,14) size 63x28
+            text run at (131,14) width 63: " years "
+          RenderInline {B} at (0,0) size 27x28
+            RenderText {TEXT} at (194,14) size 27x28
+              text run at (194,14) width 27: "as "
+          RenderText {TEXT} at (221,14) size 659x56
+            text run at (221,14) width 110: "our fathers "
+            text run at (331,14) width 342: "f upon this continent, a new nation,"
+            text run at (14,42) width 232: "conceived    in Liberty, "
+            text run at (246,42) width 392: "and dedicated to the proposition that all "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,70) size 220x28
+            text run at (14,70) width 220: "men are created equal."
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 21 of child 6 {TEXT} of child 2 {SPAN} of root {DIV}
+upstream:   position 21 of child 6 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 21 of child 6 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/selection/move-by-character-003.html b/LayoutTests/editing/selection/move-by-character-003.html
new file mode 100644 (file)
index 0000000..addca0b
--- /dev/null
@@ -0,0 +1,38 @@
+<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 < 159; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test"><i>F    and seven</i> years <b>  as </b>our fathers  f upon this
+continent, a new nation, conceived &nbsp;&nbsp; in Liberty,                 and dedicated to the
+proposition that all 
+<br>men are created equal.</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/selection/move-by-character-004-expected.txt b/LayoutTests/editing/selection/move-by-character-004-expected.txt
new file mode 100644 (file)
index 0000000..3eb37f8
--- /dev/null
@@ -0,0 +1,30 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x371
+  RenderBlock {HTML} at (0,0) size 800x371
+    RenderBody {BODY} at (8,8) size 784x355
+      RenderBlock {DIV} at (0,0) size 784x355 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 254x246
+          RenderText {TEXT} at (14,95) size 11x28
+            text run at (14,95) width 11: "a"
+          RenderImage {IMG} at (25,14) size 76x103
+          RenderText {TEXT} at (101,95) size 46x28
+            text run at (101,95) width 46: "new "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,204) size 67x28
+            text run at (14,204) width 67: "nation "
+          RenderInline {I} at (0,0) size 0x0
+            RenderText {TEXT} at (0,0) size 0x0
+          RenderText {TEXT} at (0,0) size 0x0
+          RenderImage {IMG} at (81,123) size 76x103
+          RenderText {TEXT} at (157,204) size 111x28
+            text run at (157,204) width 111: " conceived "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,313) size 61x28
+            text run at (14,313) width 61: "nation"
+          RenderImage {IMG} at (75,232) size 76x103
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 0 of child 2 {IMG} of child 2 {SPAN} of root {DIV}
+upstream:   position 1 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
+downstream: position 0 of child 2 {IMG} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/selection/move-by-character-004.html b/LayoutTests/editing/selection/move-by-character-004.html
new file mode 100644 (file)
index 0000000..76b8d68
--- /dev/null
@@ -0,0 +1,40 @@
+<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 < 33; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    for (i = 0; i < 32; i++) {
+        moveSelectionBackwardByCharacterCommand();
+    }
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">a<img src="../abe.jpg">new 
+<br>nation <i>  </i> <img src="../abe.jpg"> conceived
+<br>nation<img src="../abe.jpg"></span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/selection/move-by-character-005-expected.txt b/LayoutTests/editing/selection/move-by-character-005-expected.txt
new file mode 100644 (file)
index 0000000..a882a18
--- /dev/null
@@ -0,0 +1,29 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x128
+  RenderBlock {HTML} at (0,0) size 800x128
+    RenderBody {BODY} at (8,8) size 784x112
+      RenderBlock {DIV} at (0,0) size 784x112 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 659x84
+          RenderInline {I} at (0,0) size 117x28
+            RenderText {TEXT} at (14,14) size 117x28
+              text run at (14,14) width 21: "F "
+              text run at (35,14) width 96: "and seven"
+          RenderText {TEXT} at (131,14) size 63x28
+            text run at (131,14) width 63: " years "
+          RenderInline {B} at (0,0) size 27x28
+            RenderText {TEXT} at (194,14) size 27x28
+              text run at (194,14) width 27: "as "
+          RenderText {TEXT} at (221,14) size 659x56
+            text run at (221,14) width 110: "our fathers "
+            text run at (331,14) width 342: "f upon this continent, a new nation,"
+            text run at (14,42) width 232: "conceived    in Liberty, "
+            text run at (246,42) width 392: "and dedicated to the proposition that all "
+          RenderBR {BR} at (0,0) size 0x0
+          RenderText {TEXT} at (14,70) size 220x28
+            text run at (14,70) width 220: "men are created equal."
+        RenderText {TEXT} at (0,0) size 0x0
+selection is CARET:
+start:      position 1 of child 1 {TEXT} of child 1 {I} of child 2 {SPAN} of root {DIV}
+upstream:   position 1 of child 1 {TEXT} of child 1 {I} of child 2 {SPAN} of root {DIV}
+downstream: position 1 of child 1 {TEXT} of child 1 {I} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/selection/move-by-character-005.html b/LayoutTests/editing/selection/move-by-character-005.html
new file mode 100644 (file)
index 0000000..e468225
--- /dev/null
@@ -0,0 +1,41 @@
+<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 < 159; i++) {
+        moveSelectionForwardByCharacterCommand();
+    }
+    for (i = 0; i < 158; i++) {
+        moveSelectionBackwardByCharacterCommand();
+    }
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test"><i>F    and seven</i> years <b>  as </b>our fathers  f upon this
+continent, a new nation, conceived &nbsp;&nbsp; in Liberty,                 and dedicated to the
+proposition that all 
+<br>men are created equal.</span>
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/undo/redo-typing-001-expected.txt b/LayoutTests/editing/undo/redo-typing-001-expected.txt
new file mode 100644 (file)
index 0000000..29e150d
--- /dev/null
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 46x28
+          RenderText {TEXT} at (14,14) size 46x28
+            text run at (14,14) width 46: "xXX"
+selection is CARET:
+start:      position 1 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
+upstream:   position 1 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
+downstream: position 1 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/undo/redo-typing-001.html b/LayoutTests/editing/undo/redo-typing-001.html
new file mode 100644 (file)
index 0000000..4f6e403
--- /dev/null
@@ -0,0 +1,35 @@
+<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() {
+    typeCharacterCommand();
+    undoCommand();
+    redoCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">XX
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
diff --git a/LayoutTests/editing/undo/undo-typing-001-expected.txt b/LayoutTests/editing/undo/undo-typing-001-expected.txt
new file mode 100644 (file)
index 0000000..29e150d
--- /dev/null
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x72
+  RenderBlock {HTML} at (0,0) size 800x72
+    RenderBody {BODY} at (8,8) size 784x56
+      RenderBlock {DIV} at (0,0) size 784x56 [border: (2px solid #FF0000)]
+        RenderInline {SPAN} at (0,0) size 46x28
+          RenderText {TEXT} at (14,14) size 46x28
+            text run at (14,14) width 46: "xXX"
+selection is CARET:
+start:      position 1 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
+upstream:   position 1 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
+downstream: position 1 of child 1 {TEXT} of child 1 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/undo/undo-typing-001.html b/LayoutTests/editing/undo/undo-typing-001.html
new file mode 100644 (file)
index 0000000..b4060d9
--- /dev/null
@@ -0,0 +1,34 @@
+<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() {
+    typeCharacterCommand();
+    undoCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<span id="test">XX
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
index bb134fb..37b640d 100644 (file)
@@ -1,5 +1,81 @@
 2004-04-06  Ken Kocienda  <kocienda@apple.com>
 
+        Reviewed by me
+
+        Added a new suite of layout tests for editing, all added
+        in the new layout-tests/editing subtree.
+
+        * layout-tests/editing/abe.jpg: Added.
+        * layout-tests/editing/deleting/delete-block-contents-001-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-block-contents-001.html: Added.
+        * layout-tests/editing/deleting/delete-block-contents-002-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-block-contents-002.html: Added.
+        * layout-tests/editing/deleting/delete-block-contents-003-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-block-contents-003.html: Added.
+        * layout-tests/editing/deleting/delete-br-001-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-br-001.html: Added.
+        * layout-tests/editing/deleting/delete-br-002-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-br-002.html: Added.
+        * layout-tests/editing/deleting/delete-br-003-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-br-003.html: Added.
+        * layout-tests/editing/deleting/delete-br-004-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-br-004.html: Added.
+        * layout-tests/editing/deleting/delete-br-005-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-br-005.html: Added.
+        * layout-tests/editing/deleting/delete-br-006-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-br-006.html: Added.
+        * layout-tests/editing/deleting/delete-character-001-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-character-001.html: Added.
+        * layout-tests/editing/deleting/delete-contiguous-ws-001-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-contiguous-ws-001.html: Added.
+        * layout-tests/editing/deleting/delete-image-001-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-image-001.html: Added.
+        * layout-tests/editing/deleting/delete-image-002-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-image-002.html: Added.
+        * layout-tests/editing/deleting/delete-image-003-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-image-003.html: Added.
+        * layout-tests/editing/deleting/delete-leading-ws-001-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-leading-ws-001.html: Added.
+        * layout-tests/editing/deleting/delete-selection-001-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-selection-001.html: Added.
+        * layout-tests/editing/deleting/delete-trailing-ws-001-expected.txt: Added.
+        * layout-tests/editing/deleting/delete-trailing-ws-001.html: Added.
+        * layout-tests/editing/editing.js: Added.
+        * layout-tests/editing/inserting/typing-001-expected.txt: Added.
+        * layout-tests/editing/inserting/typing-001.html: Added.
+        * layout-tests/editing/inserting/typing-002-expected.txt: Added.
+        * layout-tests/editing/inserting/typing-002.html: Added.
+        * layout-tests/editing/inserting/typing-around-br-001-expected.txt: Added.
+        * layout-tests/editing/inserting/typing-around-br-001.html: Added.
+        * layout-tests/editing/inserting/typing-around-image-001-expected.txt: Added.
+        * layout-tests/editing/inserting/typing-around-image-001.html: Added.
+        * layout-tests/editing/selection/extend-by-character-001-expected.txt: Added.
+        * layout-tests/editing/selection/extend-by-character-001.html: Added.
+        * layout-tests/editing/selection/extend-by-character-002-expected.txt: Added.
+        * layout-tests/editing/selection/extend-by-character-002.html: Added.
+        * layout-tests/editing/selection/extend-by-character-003-expected.txt: Added.
+        * layout-tests/editing/selection/extend-by-character-003.html: Added.
+        * layout-tests/editing/selection/extend-by-character-004-expected.txt: Added.
+        * layout-tests/editing/selection/extend-by-character-004.html: Added.
+        * layout-tests/editing/selection/extend-by-character-005-expected.txt: Added.
+        * layout-tests/editing/selection/extend-by-character-005.html: Added.
+        * layout-tests/editing/selection/move-by-character-001-expected.txt: Added.
+        * layout-tests/editing/selection/move-by-character-001.html: Added.
+        * layout-tests/editing/selection/move-by-character-002-expected.txt: Added.
+        * layout-tests/editing/selection/move-by-character-002.html: Added.
+        * layout-tests/editing/selection/move-by-character-003-expected.txt: Added.
+        * layout-tests/editing/selection/move-by-character-003.html: Added.
+        * layout-tests/editing/selection/move-by-character-004-expected.txt: Added.
+        * layout-tests/editing/selection/move-by-character-004.html: Added.
+        * layout-tests/editing/selection/move-by-character-005-expected.txt: Added.
+        * layout-tests/editing/selection/move-by-character-005.html: Added.
+        * layout-tests/editing/undo/redo-typing-001-expected.txt: Added.
+        * layout-tests/editing/undo/redo-typing-001.html: Added.
+        * layout-tests/editing/undo/undo-typing-001-expected.txt: Added.
+        * layout-tests/editing/undo/undo-typing-001.html: Added.
+
+2004-04-06  Ken Kocienda  <kocienda@apple.com>
+
         Reviewed by Dave
 
         Added execCommand feature.