[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

rniwa at webkit.org rniwa at webkit.org
Wed Dec 22 14:27:47 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 3ce20555d85135365b457e50ecdc57baa9754c83
Author: rniwa at webkit.org <rniwa at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Oct 9 19:49:48 2010 +0000

    2010-10-08  Ryosuke Niwa  <rniwa at webkit.org>
    
            Reviewed by Darin Adler.
    
            Redo in ReplaceNodeWithSpanCommand is broken
            https://bugs.webkit.org/show_bug.cgi?id=47428
    
            The bug was caused by ReplaceNodeWithSpanCommand's inheriting from CompositeEditCommand,
            and ReplaceNodeWithSpanCommand's not implementing doReapply. Because ReplaceNodeWithSpanCommand's doApply
            directly modifies DOM and does not use simple edit commands while CompositeEditCommand's doReapply
            only calls reapply of compositing simple edit commands, ReplaceNodeWithSpanCommand's doReapply was no-op.
    
            Fixed the bug by changing the base class of ReplaceNodeWithSpanCommand to SimpleEditCommand.
            This allows ReplaceNodeWithSpanCommand's doReapply to call its doApply, which already supports redo operation.
    
            Test: editing/undo/replace-by-span-then-remove.html
    
            * editing/ApplyStyleCommand.h:
            (WebCore::ApplyStyleCommand::printStyle):
            * editing/ReplaceNodeWithSpanCommand.cpp:
            (WebCore::ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand):
            * editing/ReplaceNodeWithSpanCommand.h:
    2010-10-08  Ryosuke Niwa  <rniwa at webkit.org>
    
            Reviewed by Darin Adler.
    
            Redo in ReplaceNodeWithSpanCommand is broken
            https://bugs.webkit.org/show_bug.cgi?id=47428
    
            Added a test to ensure replacing a node with span can be redone,
            and doing so does not disrupt subsequent redo's.
    
            * editing/undo/replace-by-span-then-remove-expected.txt: Added.
            * editing/undo/replace-by-span-then-remove.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69453 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1d7aafa..afe9768 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-10-08  Ryosuke Niwa  <rniwa at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Redo in ReplaceNodeWithSpanCommand is broken
+        https://bugs.webkit.org/show_bug.cgi?id=47428
+
+        Added a test to ensure replacing a node with span can be redone,
+        and doing so does not disrupt subsequent redo's.
+
+        * editing/undo/replace-by-span-then-remove-expected.txt: Added.
+        * editing/undo/replace-by-span-then-remove.html: Added.
+
 2010-10-09  Robert Hogan  <robert at webkit.org>
 
         Reviewed by Andreas Kling.
diff --git a/LayoutTests/editing/undo/replace-by-span-then-remove-expected.txt b/LayoutTests/editing/undo/replace-by-span-then-remove-expected.txt
new file mode 100644
index 0000000..bcc4a0c
--- /dev/null
+++ b/LayoutTests/editing/undo/replace-by-span-then-remove-expected.txt
@@ -0,0 +1,7 @@
+initial:<b style="font-style: italic; ">world</b>
+after removing bold:<span style="font-style: italic; ">world</span>
+after removing italic:world
+after undo:<b style="font-style: italic; ">world</b>
+after redo:world
+PASS
+
diff --git a/LayoutTests/editing/undo/replace-by-span-then-remove.html b/LayoutTests/editing/undo/replace-by-span-then-remove.html
new file mode 100644
index 0000000..f74f19e
--- /dev/null
+++ b/LayoutTests/editing/undo/replace-by-span-then-remove.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div id="test" contenteditable><b style="font-style: italic; ">world</b></div>
+<pre id="console">
+</pre>
+<script>
+
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+var test = document.getElementById('test');
+window.getSelection().selectAllChildren(test);
+
+var console = document.getElementById('console');
+var initialValue = test.innerHTML;
+var failed = false;
+console.appendChild(document.createTextNode('initial:' + test.innerHTML + '\n'));
+document.execCommand('bold', false, null);
+console.appendChild(document.createTextNode('after removing bold:' + test.innerHTML + '\n'));
+document.execCommand('italic', false, null);
+console.appendChild(document.createTextNode('after removing italic:' + test.innerHTML + '\n'));
+var finalValue = test.innerHTML;
+
+document.execCommand('undo', false, null);
+document.execCommand('undo', false, null);
+console.appendChild(document.createTextNode('after undo:' + test.innerHTML + '\n'));
+if (test.innerHTML != initialValue) {
+    console.appendChild(document.createTextNode('but expected ' + initialValue + '\n'));
+    failed = true;
+}
+document.execCommand('redo', false, null);
+document.execCommand('redo', false, null);
+console.appendChild(document.createTextNode('after redo:' + test.innerHTML + '\n'));
+if (test.innerHTML != finalValue) {
+    console.appendChild(document.createTextNode('but expected ' + finalValue + '\n'));
+    failed = true;
+}
+
+test.innerHTML = '';
+
+console.appendChild(document.createTextNode(failed ? 'FAIL\n' : 'PASS\n'));
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/platform/chromium-win/editing/inserting/editable-html-element-expected.txt b/LayoutTests/platform/chromium-win/editing/inserting/editable-html-element-expected.txt
index 07f83cb..e445350 100644
--- a/LayoutTests/platform/chromium-win/editing/inserting/editable-html-element-expected.txt
+++ b/LayoutTests/platform/chromium-win/editing/inserting/editable-html-element-expected.txt
@@ -1,4 +1,4 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 1 of BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document toDOMRange:range from 259 of #text > BODY > HTML > #document to 259 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
diff --git a/LayoutTests/platform/chromium-win/editing/selection/editable-html-element-expected.txt b/LayoutTests/platform/chromium-win/editing/selection/editable-html-element-expected.txt
index 9972b34..7abe726 100644
--- a/LayoutTests/platform/chromium-win/editing/selection/editable-html-element-expected.txt
+++ b/LayoutTests/platform/chromium-win/editing/selection/editable-html-element-expected.txt
@@ -1,6 +1,10 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 1 of BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
+EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 1 of BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > BODY > HTML > #document to 1 of #text > SPAN > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
diff --git a/LayoutTests/platform/chromium-win/editing/selection/editable-links-expected.txt b/LayoutTests/platform/chromium-win/editing/selection/editable-links-expected.txt
index e7c27e9..f892f26 100644
--- a/LayoutTests/platform/chromium-win/editing/selection/editable-links-expected.txt
+++ b/LayoutTests/platform/chromium-win/editing/selection/editable-links-expected.txt
@@ -1,4 +1,4 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 5 of BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 6 of #text > A > BODY > HTML > #document to 6 of #text > A > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
diff --git a/LayoutTests/platform/chromium-win/editing/selection/focus_editable_html-expected.txt b/LayoutTests/platform/chromium-win/editing/selection/focus_editable_html-expected.txt
index 7e2b0c6..df7d81f 100644
--- a/LayoutTests/platform/chromium-win/editing/selection/focus_editable_html-expected.txt
+++ b/LayoutTests/platform/chromium-win/editing/selection/focus_editable_html-expected.txt
@@ -1,6 +1,10 @@
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
+EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 9 of BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 layer at (0,0) size 2008x2096
   RenderView at (0,0) size 785x585
diff --git a/LayoutTests/platform/chromium-win/editing/style/designmode-expected.txt b/LayoutTests/platform/chromium-win/editing/style/designmode-expected.txt
index f1163e8..0a0e6eb 100644
--- a/LayoutTests/platform/chromium-win/editing/style/designmode-expected.txt
+++ b/LayoutTests/platform/chromium-win/editing/style/designmode-expected.txt
@@ -1,4 +1,4 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
+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: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
diff --git a/LayoutTests/platform/qt/editing/inserting/editable-html-element-expected.txt b/LayoutTests/platform/qt/editing/inserting/editable-html-element-expected.txt
index c9996df..06b5ce5 100644
--- a/LayoutTests/platform/qt/editing/inserting/editable-html-element-expected.txt
+++ b/LayoutTests/platform/qt/editing/inserting/editable-html-element-expected.txt
@@ -1,4 +1,4 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 1 of BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document toDOMRange:range from 259 of #text > BODY > HTML > #document to 259 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
diff --git a/LayoutTests/platform/qt/editing/selection/editable-html-element-expected.txt b/LayoutTests/platform/qt/editing/selection/editable-html-element-expected.txt
index 6847f16..e772b21 100644
--- a/LayoutTests/platform/qt/editing/selection/editable-html-element-expected.txt
+++ b/LayoutTests/platform/qt/editing/selection/editable-html-element-expected.txt
@@ -1,6 +1,10 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 1 of BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
+EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 1 of BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document toDOMRange:range from 1 of #text > SPAN > BODY > HTML > #document to 1 of #text > SPAN > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
diff --git a/LayoutTests/platform/qt/editing/selection/focus_editable_html-expected.txt b/LayoutTests/platform/qt/editing/selection/focus_editable_html-expected.txt
index 83a1be3..0555766 100644
--- a/LayoutTests/platform/qt/editing/selection/focus_editable_html-expected.txt
+++ b/LayoutTests/platform/qt/editing/selection/focus_editable_html-expected.txt
@@ -1,6 +1,10 @@
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldEndEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
+EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 9 of BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 layer at (0,0) size 2008x2093
   RenderView at (0,0) size 800x600
diff --git a/LayoutTests/platform/qt/editing/style/designmode-expected.txt b/LayoutTests/platform/qt/editing/style/designmode-expected.txt
index ba1ea91..389601b 100644
--- a/LayoutTests/platform/qt/editing/style/designmode-expected.txt
+++ b/LayoutTests/platform/qt/editing/style/designmode-expected.txt
@@ -1,4 +1,4 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 2 of HTML > #document
+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: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5afe066..f16ad45 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2010-10-08  Ryosuke Niwa  <rniwa at webkit.org>
+
+        Reviewed by Darin Adler.
+
+        Redo in ReplaceNodeWithSpanCommand is broken
+        https://bugs.webkit.org/show_bug.cgi?id=47428
+
+        The bug was caused by ReplaceNodeWithSpanCommand's inheriting from CompositeEditCommand,
+        and ReplaceNodeWithSpanCommand's not implementing doReapply. Because ReplaceNodeWithSpanCommand's doApply
+        directly modifies DOM and does not use simple edit commands while CompositeEditCommand's doReapply
+        only calls reapply of compositing simple edit commands, ReplaceNodeWithSpanCommand's doReapply was no-op.
+
+        Fixed the bug by changing the base class of ReplaceNodeWithSpanCommand to SimpleEditCommand.
+        This allows ReplaceNodeWithSpanCommand's doReapply to call its doApply, which already supports redo operation.
+
+        Test: editing/undo/replace-by-span-then-remove.html
+
+        * editing/ApplyStyleCommand.h:
+        (WebCore::ApplyStyleCommand::printStyle):
+        * editing/ReplaceNodeWithSpanCommand.cpp:
+        (WebCore::ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand):
+        * editing/ReplaceNodeWithSpanCommand.h:
+
 2010-10-09  Carlos Garcia Campos  <cgarcia at igalia.com>
 
         Reviewed by Martin Robinson.
diff --git a/WebCore/editing/ReplaceNodeWithSpanCommand.cpp b/WebCore/editing/ReplaceNodeWithSpanCommand.cpp
index c3b6b89..ae181a2 100644
--- a/WebCore/editing/ReplaceNodeWithSpanCommand.cpp
+++ b/WebCore/editing/ReplaceNodeWithSpanCommand.cpp
@@ -42,7 +42,7 @@ namespace WebCore {
 using namespace HTMLNames;
 
 ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand(PassRefPtr<Node> node)
-    : CompositeEditCommand(node->document())
+    : SimpleEditCommand(node->document())
     , m_node(node)
 {
     ASSERT(m_node);
diff --git a/WebCore/editing/ReplaceNodeWithSpanCommand.h b/WebCore/editing/ReplaceNodeWithSpanCommand.h
index 7b375b6..6c02fc6 100644
--- a/WebCore/editing/ReplaceNodeWithSpanCommand.h
+++ b/WebCore/editing/ReplaceNodeWithSpanCommand.h
@@ -38,7 +38,7 @@ namespace WebCore {
 class HTMLElement;
 
 // More accurately, this is ReplaceNodeWithSpanPreservingChildrenAndAttributesCommand
-class ReplaceNodeWithSpanCommand : public CompositeEditCommand {
+class ReplaceNodeWithSpanCommand : public SimpleEditCommand {
 public:
     static PassRefPtr<ReplaceNodeWithSpanCommand> create(PassRefPtr<Node> node)
     {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list