2009-06-19 Ryosuke Niwa <rniwa@google.com>
authorbfulgham@webkit.org <bfulgham@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Jun 2009 00:27:00 +0000 (00:27 +0000)
committerbfulgham@webkit.org <bfulgham@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Jun 2009 00:27:00 +0000 (00:27 +0000)
        Reviewed by Maciej Stachowiak.

        This fixs the bug 26361. The original test case did not invoke the event that
        triggered the actual test. This patch adds code to invoke this event, and also
        converts it from a pixel test to a dumpAsText test.

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

LayoutTests/ChangeLog
LayoutTests/editing/deleting/5156801-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/5156801.html
LayoutTests/platform/mac/editing/deleting/5156801-expected.checksum [deleted file]
LayoutTests/platform/mac/editing/deleting/5156801-expected.png [deleted file]
LayoutTests/platform/mac/editing/deleting/5156801-expected.txt [deleted file]
LayoutTests/platform/qt/editing/deleting/5156801-expected.txt [deleted file]

index 8ca801a..5a78382 100644 (file)
@@ -1,3 +1,18 @@
+2009-06-19  Ryosuke Niwa  <rniwa@google.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        This fixs the bug 26361. The original test case did not invoke the event that
+        triggered the actual test. This patch adds code to invoke this event, and also
+        converts it from a pixel test to a dumpAsText test.
+
+        * editing/deleting/5156801-expected.txt: Added.
+        * editing/deleting/5156801.html:
+        * platform/mac/editing/deleting/5156801-expected.checksum: Removed.
+        * platform/mac/editing/deleting/5156801-expected.png: Removed.
+        * platform/mac/editing/deleting/5156801-expected.txt: Removed.
+        * platform/qt/editing/deleting/5156801-expected.txt: Removed.
+
 2009-06-19  David Hyatt  <hyatt@apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/LayoutTests/editing/deleting/5156801-expected.txt b/LayoutTests/editing/deleting/5156801-expected.txt
new file mode 100644 (file)
index 0000000..584b1aa
--- /dev/null
@@ -0,0 +1,6 @@
+This tests for a bug where delete would crash if a node just after the selection to delete is removed in a DOMNodeRemoved event handler for the last node in the selection to delete.
+
+foo
+foo
+
+PASS
index cc4c8fe..1139435 100644 (file)
@@ -1,11 +1,30 @@
 <p>This tests for a bug where delete would crash if a node just after the selection to delete is removed in a DOMNodeRemoved event handler for the last node in the selection to delete.</p>
-<div contenteditable="true">foo<span id="foo">x</span><span id="removeme">y</span></div>
+<div id="div" contenteditable="true">foo<span id="foo">x</span><span id="removeme">y</span></div>
+<p id="console"></p>
 
 <script>
+
+if (window.layoutTestController)
+    window.layoutTestController.dumpAsText();
+
+function log(message) {
+    var console = document.getElementById("console");
+    var text = document.createTextNode(message);
+    console.appendChild(text);
+}
+
 function removeHandler() {
     var removeme = document.getElementById("removeme");
     removeme.parentNode.removeChild(removeme);
 }
 
 document.getElementById("foo").addEventListener("DOMNodeRemoved", removeHandler);
+var sel = window.getSelection();
+sel.setBaseAndExtent( document.getElementById('foo'), 0, document.getElementById('foo'), 1 );
+document.execCommand("Delete");
+
+log(document.getElementById('div').innerHTML);
+
 </script>
+
+PASS
diff --git a/LayoutTests/platform/mac/editing/deleting/5156801-expected.checksum b/LayoutTests/platform/mac/editing/deleting/5156801-expected.checksum
deleted file mode 100644 (file)
index 53d82e3..0000000
+++ /dev/null
@@ -1 +0,0 @@
-ffba1820b212ecbb675c66b1bddb7d5a
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/editing/deleting/5156801-expected.png b/LayoutTests/platform/mac/editing/deleting/5156801-expected.png
deleted file mode 100644 (file)
index e446728..0000000
Binary files a/LayoutTests/platform/mac/editing/deleting/5156801-expected.png and /dev/null differ
diff --git a/LayoutTests/platform/mac/editing/deleting/5156801-expected.txt b/LayoutTests/platform/mac/editing/deleting/5156801-expected.txt
deleted file mode 100644 (file)
index 1bb98d6..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView 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 {P} at (0,0) size 784x36
-        RenderText {#text} at (0,0) size 779x36
-          text run at (0,0) width 779: "This tests for a bug where delete would crash if a node just after the selection to delete is removed in a DOMNodeRemoved"
-          text run at (0,18) width 349: "event handler for the last node in the selection to delete."
-      RenderBlock {DIV} at (0,52) size 784x18
-        RenderText {#text} at (0,0) size 21x18
-          text run at (0,0) width 21: "foo"
-        RenderInline {SPAN} at (0,0) size 8x18
-          RenderText {#text} at (21,0) size 8x18
-            text run at (21,0) width 8: "x"
-        RenderInline {SPAN} at (0,0) size 8x18
-          RenderText {#text} at (29,0) size 8x18
-            text run at (29,0) width 8: "y"
diff --git a/LayoutTests/platform/qt/editing/deleting/5156801-expected.txt b/LayoutTests/platform/qt/editing/deleting/5156801-expected.txt
deleted file mode 100644 (file)
index a383f10..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-layer at (0,0) size 800x600
-  RenderView 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 {P} at (0,0) size 784x38
-        RenderText {#text} at (0,0) size 782x38
-          text run at (0,0) width 782: "This tests for a bug where delete would crash if a node just after the selection to delete is removed in a DOMNodeRemoved"
-          text run at (0,19) width 356: "event handler for the last node in the selection to delete."
-      RenderBlock {DIV} at (0,52) size 784x19
-        RenderText {#text} at (0,0) size 20x19
-          text run at (0,0) width 20: "foo"
-        RenderInline {SPAN} at (0,0) size 7x19
-          RenderText {#text} at (20,0) size 7x19
-            text run at (20,0) width 7: "x"
-        RenderInline {SPAN} at (0,0) size 7x19
-          RenderText {#text} at (27,0) size 7x19
-            text run at (27,0) width 7: "y"