LayoutTests:
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Nov 2006 18:08:52 +0000 (18:08 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Nov 2006 18:08:52 +0000 (18:08 +0000)
        Reviewed by Darin.

        <rdar://problem/4813973> Pressing delete key to remove empty quoted line leaves cursor mis-positioned

        * editing/deleting/delete-br-012-expected.checksum: Added.
        * editing/deleting/delete-br-012-expected.png: Added.
        * editing/deleting/delete-br-012-expected.txt: Added.
        * editing/deleting/delete-br-012.html: Added.

WebCore:

        Reviewed by Darin.

        <rdar://problem/4813973> Pressing delete key to remove empty quoted line leaves cursor mis-positioned

        Test:
        * editing/deleting/delete-br-012.html

        * editing/DeleteSelectionCommand.cpp:
        (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete):
        Update m_endingPosition when preventing merge.
        Also removed setting of m_mergeBlocksAfterDelete when this function returns true, because is is not checked in this case.

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

LayoutTests/ChangeLog
LayoutTests/editing/deleting/delete-br-012-expected.checksum [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-012-expected.png [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-012-expected.txt [new file with mode: 0644]
LayoutTests/editing/deleting/delete-br-012.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/editing/DeleteSelectionCommand.cpp

index fad3c9a36907ae576b48cbf8b39424064b11f918..87f3a2508dc7a656a943c944be82b7defcaaeafb 100644 (file)
@@ -1,3 +1,14 @@
+2006-11-06  David Harrison  <harrison@apple.com>
+
+        Reviewed by Darin.
+
+        <rdar://problem/4813973> Pressing delete key to remove empty quoted line leaves cursor mis-positioned
+
+        * editing/deleting/delete-br-012-expected.checksum: Added.
+        * editing/deleting/delete-br-012-expected.png: Added.
+        * editing/deleting/delete-br-012-expected.txt: Added.
+        * editing/deleting/delete-br-012.html: Added.
+
 2006-11-06  Alexey Proskuryakov  <ap@nypop.com>
 
         Reviewed by Sam Weinig.
diff --git a/LayoutTests/editing/deleting/delete-br-012-expected.checksum b/LayoutTests/editing/deleting/delete-br-012-expected.checksum
new file mode 100644 (file)
index 0000000..31ef9ae
--- /dev/null
@@ -0,0 +1 @@
+9119ef6ae00aa9d31fdd67d75ac7f806
\ No newline at end of file
diff --git a/LayoutTests/editing/deleting/delete-br-012-expected.png b/LayoutTests/editing/deleting/delete-br-012-expected.png
new file mode 100644 (file)
index 0000000..94786e1
Binary files /dev/null and b/LayoutTests/editing/deleting/delete-br-012-expected.png differ
diff --git a/LayoutTests/editing/deleting/delete-br-012-expected.txt b/LayoutTests/editing/deleting/delete-br-012-expected.txt
new file mode 100644 (file)
index 0000000..5b5dbca
--- /dev/null
@@ -0,0 +1,19 @@
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 5 of BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldDeleteDOMRange:range from 3 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+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 {DIV} at (0,0) size 784x62 [border: (2px solid #FF0000)]
+        RenderBlock {DIV} at (14,14) size 756x34 [border: (3px solid #000000)]
+          RenderText {#text} at (3,3) size 49x28
+            text run at (3,3) width 49: "hello"
+        RenderBlock (anonymous) at (14,48) size 756x0
+      RenderBlock {DIV} at (0,62) size 784x24 [border: (3px solid #0000FF)]
+        RenderBR {BR} at (3,3) size 0x18
+caret: position 0 of child 0 {BR} of child 2 {DIV} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/deleting/delete-br-012.html b/LayoutTests/editing/deleting/delete-br-012.html
new file mode 100644 (file)
index 0000000..7eaa91d
--- /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() {
+    deleteCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body onload="runEditingTest();" contenteditable id="root">
+<div class="editing">
+    <div style="border-style:solid; border-color:black;">
+        hello
+    </div>
+    <br>
+</div>
+<div id="test" style="border-style:solid; border-color:blue;">
+    <br>
+</div>
+
+</body></html>
\ No newline at end of file
index d8df8ba48de0e775587792dc4cf33fdfe9e9ffb8..125560d0f8e63fef31864361f08837f5e3153564 100644 (file)
@@ -1,3 +1,17 @@
+2006-11-06  David Harrison  <harrison@apple.com>
+
+        Reviewed by Darin.
+
+        <rdar://problem/4813973> Pressing delete key to remove empty quoted line leaves cursor mis-positioned
+
+        Test:
+        * editing/deleting/delete-br-012.html
+        
+        * editing/DeleteSelectionCommand.cpp:
+        (WebCore::DeleteSelectionCommand::handleSpecialCaseBRDelete):
+        Update m_endingPosition when preventing merge.
+        Also removed setting of m_mergeBlocksAfterDelete when this function returns true, because is is not checked in this case.
+
 2006-11-06  Mark Rowe  <bdash@webkit.org>
 
         Reviewed by Maciej.
index aab99e3a305c9dbfc380717e7906ae6e3fe8525f..0f3629add4057b90f821f87526eb027b9f0bea22 100644 (file)
@@ -194,15 +194,16 @@ bool DeleteSelectionCommand::handleSpecialCaseBRDelete()
     bool isBROnLineByItself = upstreamStartIsBR && downstreamStartIsBR && m_downstreamStart.node() == m_upstreamEnd.node();
     if (isBROnLineByItself) {
         removeNode(m_downstreamStart.node());
-        m_mergeBlocksAfterDelete = false;
         return true;
     }
 
     // Not a special-case delete per se, but we can detect that the merging of content between blocks
     // should not be done.
-    if (upstreamStartIsBR && downstreamStartIsBR)
+    if (upstreamStartIsBR && downstreamStartIsBR) {
         m_mergeBlocksAfterDelete = false;
-
+        m_endingPosition = m_downstreamEnd;
+    }
+    
     return false;
 }