Reviewed by me
authorkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Aug 2004 15:41:34 +0000 (15:41 +0000)
committerkocienda <kocienda@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Aug 2004 15:41:34 +0000 (15:41 +0000)
        Added more editing layout tests.

        * layout-tests/editing/deleting/collapse-whitespace-3587601-fix-expected.txt: Added.
        * layout-tests/editing/deleting/collapse-whitespace-3587601-fix.html: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-001-expected.txt: Added.
        * layout-tests/editing/deleting/delete-block-merge-contents-001.html: Added.
        * layout-tests/editing/editing.js: Added some more navigation commands.
        * layout-tests/editing/inserting/insert-3778059-fix-expected.txt: Added.
        * layout-tests/editing/inserting/insert-3778059-fix.html: Added.
        * layout-tests/editing/selection/move-by-line-001-expected.txt: Added.
        * layout-tests/editing/selection/move-by-line-001.html: Added.
        * layout-tests/editing/style/typing-style-003-expected.txt: Added.
        * layout-tests/editing/style/typing-style-003.html: Added.

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

12 files changed:
LayoutTests/editing/deleting/collapse-whitespace-3587601-fix-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/collapse-whitespace-3587601-fix.html [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-block-merge-contents-001.html [new file with mode: 0644]
LayoutTests/editing/editing.js
LayoutTests/editing/inserting/insert-3778059-fix-expected.txt [new file with mode: 0644]
LayoutTests/editing/inserting/insert-3778059-fix.html [new file with mode: 0644]
LayoutTests/editing/selection/move-by-line-001-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/move-by-line-001.html [new file with mode: 0644]
LayoutTests/editing/style/typing-style-003-expected.txt [new file with mode: 0644]
LayoutTests/editing/style/typing-style-003.html [new file with mode: 0644]
WebCore/ChangeLog-2005-08-23

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