[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

enrica at apple.com enrica at apple.com
Thu Apr 8 00:36:01 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit bde8a9aeadf982f12e9c3d76b523c225dc55f460
Author: enrica at apple.com <enrica at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 15 01:14:35 2009 +0000

    Pressing backspace inside a table cell erases all empty rows below it.
    <rdar://problem/5565461>
    https://bugs.webkit.org/show_bug.cgi?id=32526
    
    Reviewed by John Sullivan.
    
    WebCore:
    
    No deletion is performed when the caret selection is on an empty table cell.
    
    Test: editing/deleting/delete-empty-table.html
    
    * editing/TypingCommand.cpp:
    (WebCore::TypingCommand::deleteKeyPressed): Added check for empty table cells in
    case of caret selection.
    
    LayoutTests:
    
    * editing/deleting/delete-empty-table-expected.txt: Added.
    * editing/deleting/delete-empty-table.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52126 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a2949b7..29306fd 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2009-12-14  Enrica Casucci  <enrica at apple.com>
+
+        Reviewed by John Sullivan.
+
+        Pressing backspace inside a table cell erases all empty rows below it.
+        <rdar://problem/5565461>
+        https://bugs.webkit.org/show_bug.cgi?id=32526
+
+        * editing/deleting/delete-empty-table-expected.txt: Added.
+        * editing/deleting/delete-empty-table.html: Added.
+
 2009-12-14  Brian Weinstein  <bweinstein at apple.com>
 
         Rubber-stamped by Brady Eidson.
diff --git a/LayoutTests/editing/deleting/delete-empty-table-expected.txt b/LayoutTests/editing/deleting/delete-empty-table-expected.txt
new file mode 100644
index 0000000..f239f2a
--- /dev/null
+++ b/LayoutTests/editing/deleting/delete-empty-table-expected.txt
@@ -0,0 +1,8 @@
+Radar 5565461 
+Bug 32526
+
+Executing delete command when the selection is on a cell of a table shouldn't remove the entire row.
+
+Executing delete command when the selection is on the last cell of a table shouldn't remove the entire table.
+
+
diff --git a/LayoutTests/editing/deleting/delete-empty-table.html b/LayoutTests/editing/deleting/delete-empty-table.html
new file mode 100644
index 0000000..a6076d6
--- /dev/null
+++ b/LayoutTests/editing/deleting/delete-empty-table.html
@@ -0,0 +1,34 @@
+<script>
+function runTest(num)
+{
+    sel = window.getSelection();
+    start = document.getElementById("test" + num + "start");
+    end = document.getElementById("test" + num + "end");
+    sel.setBaseAndExtent(start, 0, start, 0);
+    document.execCommand("Delete");
+}
+</script>
+<p><a href="rdar://problem/5565461"> Radar 5565461</a>
+<br>
+<a href="https://bugs.webkit.org/show_bug.cgi?id=32526">Bug 32526</a>
+</p>
+<p>Executing delete command when the selection is on a cell of a table shouldn't remove the entire row.
+</p>
+<div contenteditable="true">
+<table border="1" cellspacing="0"><tr><td width="50" height="25pt" id="test1start"></td></tr><tr><td width="50" height="25pt"></td></tr></table>
+</div>
+
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+runTest(1);
+</script>
+
+<p>Executing delete command when the selection is on the last cell of a table shouldn't remove the entire table.
+</p>
+<div contenteditable="true">
+<table border="1" cellspacing="0"><tr><td width="50" height="25pt"></td></tr><tr><td width="50" height="25pt" id="test2start"></td></tr></table>
+</div>
+
+<script>runTest(2);</script>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 081218d..013e0fe 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2009-12-14  Enrica Casucci  <enrica at apple.com>
+
+        Reviewed by John Sullivan.
+
+        Pressing backspace inside a table cell erases all empty rows below it.
+        <rdar://problem/5565461>
+        https://bugs.webkit.org/show_bug.cgi?id=32526
+
+        No deletion is performed when the caret selection is on an empty table cell.
+        
+        Test: editing/deleting/delete-empty-table.html
+
+        * editing/TypingCommand.cpp:
+        (WebCore::TypingCommand::deleteKeyPressed): Added check for empty table cells in
+        case of caret selection.
+
 2009-12-14  Andrei Popescu  <andreip at google.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/editing/TypingCommand.cpp b/WebCore/editing/TypingCommand.cpp
index 2b0f61e..1dc87a8 100644
--- a/WebCore/editing/TypingCommand.cpp
+++ b/WebCore/editing/TypingCommand.cpp
@@ -450,6 +450,11 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)
             }
             
             VisiblePosition visibleStart(endingSelection().visibleStart());
+            Node *startNode = visibleStart.deepEquivalent().node();
+            // If we have a caret selection on an empty cell, we have nothing to do.
+            if (startNode && startNode->renderer() && (startNode->renderer()->isTableCell() || (startNode->renderer()->isBR() && startNode->parentNode()->renderer() && startNode->parentNode()->renderer()->isTableCell())))
+                return;
+
             // If the caret is at the start of a paragraph after a table, move content into the last table cell.
             if (isStartOfParagraph(visibleStart) && isFirstPositionAfterTable(visibleStart.previous(true))) {
                 // Unless the caret is just before a table.  We don't want to move a table into the last table cell.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list