[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:25:36 UTC 2010


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

    WebCore: REGRESSION(4.0.4-42a12): Indent does not work for twice modified with background text in gmail.
    <rdar://problem/7442387>
    https://bugs.webkit.org/show_bug.cgi?id=32233
    
    Reviewed by Darin Adler.
    
    Fixes problem in re-creating the correct hierarchy under the new block.
    Added extensive testing to cover all the cases.
    
    Test: editing/execCommand/indent-with-style2.html
    
    * editing/CompositeEditCommand.cpp:
    (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
    
    LayoutTests: REGRESSION(4.0.4-42a12): Indent does not work for twice modified with background text in gmail.
    <rdar://problem/7442387>
    https://bugs.webkit.org/show_bug.cgi?id=32233
    
    Reviewed by Darin Adler.
    
    * editing/execCommand/indent-with-style2-expected.txt: Added.
    * editing/execCommand/indent-with-style2.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51819 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 71a5c6d..9f49b0e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2009-12-07  Enrica Casucci  <enrica at apple.com>
+
+        Reviewed by Darin Adler.
+
+        REGRESSION(4.0.4-42a12): Indent does not work for twice modified with background text in gmail.
+        <rdar://problem/7442387>
+        https://bugs.webkit.org/show_bug.cgi?id=32233
+
+        * editing/execCommand/indent-with-style2-expected.txt: Added.
+        * editing/execCommand/indent-with-style2.html: Added.
+
 2009-12-07  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Not reviewed. Add some missing files that depend on SVG Filters support, only mac supports it for now.
diff --git a/LayoutTests/editing/execCommand/indent-with-style2-expected.txt b/LayoutTests/editing/execCommand/indent-with-style2-expected.txt
new file mode 100644
index 0000000..4f961c3
--- /dev/null
+++ b/LayoutTests/editing/execCommand/indent-with-style2-expected.txt
@@ -0,0 +1,10 @@
+This tests indenting paragraphs with different inline styles combinations.
+Bug 32233 Radar 7442387
+
+one
+two three
+fourfive
+four
+foobar
+Before: one <div id="test1"><span class="Apple-style-span" style="background-color: rgb(255, 0, 0);">two</span> three</div> <div id="test2">four<span class="Apple-style-span" style="background-color: rgb(255, 0, 0);">five</span></div> <div><span class="Apple-style-span" style="background-color: rgb(255, 0, 0);">four</span></div> <ul><li><b>foo</b>bar</li></ul>
+After: <blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"> one <div id="test1"><span class="Apple-style-span" style="background-color: rgb(255, 0, 0);">two</span> three</div><div id="test2">four<span class="Apple-style-span" style="background-color: rgb(255, 0, 0);">five</span></div><div><span class="Apple-style-span" style="background-color: rgb(255, 0, 0);">four</span></div></blockquote> <ul><ul><li><b>foo</b>bar</li></ul></ul>
diff --git a/LayoutTests/editing/execCommand/indent-with-style2.html b/LayoutTests/editing/execCommand/indent-with-style2.html
new file mode 100644
index 0000000..7a9c3cb
--- /dev/null
+++ b/LayoutTests/editing/execCommand/indent-with-style2.html
@@ -0,0 +1,39 @@
+<html>
+<body>
+This tests indenting paragraphs with different inline styles combinations.
+<p>
+<a href="https://bugs.webkit.org/show_bug.cgi?id=32233">Bug 32233</a>
+<a href="rdar://problem/7442387"> Radar 7442387</a>
+</p>
+<div id="e" contenteditable="true">
+    one
+    <div id="test1"><span class="Apple-style-span" style="background-color: rgb(255, 0, 0);">two</span> three</div>
+    <div id="test2">four<span class="Apple-style-span" style="background-color: rgb(255, 0, 0);">five</span></div>
+    <div><span class="Apple-style-span" style="background-color: rgb(255, 0, 0);">four</span></div>
+    <ul><li><b>foo</b>bar</li></ul>
+</div>
+<ul id="console"></ul>
+
+<script type="text/javascript">
+
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+}
+var elem = document.getElementById("e");
+var selection = window.getSelection();
+selection.setPosition(elem, 0);
+
+log("Before: " + elem.innerHTML);
+document.execCommand("SelectAll");
+document.execCommand("Indent");
+log("After: " + elem.innerHTML);
+
+function log(str) {
+    var li = document.createElement("li");
+    li.appendChild(document.createTextNode(str));
+    var console = document.getElementById("console");
+    console.appendChild(li);
+}
+</script>
+</body>
+</html>
\ No newline at end of file
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a087bb1..b5e0c81 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2009-12-07  Enrica Casucci  <enrica at apple.com>
+
+        Reviewed by Darin Adler.
+
+        REGRESSION(4.0.4-42a12): Indent does not work for twice modified with background text in gmail.
+        <rdar://problem/7442387>
+        https://bugs.webkit.org/show_bug.cgi?id=32233
+        
+        Fixes problem in re-creating the correct hierarchy under the new block.
+        Added extensive testing to cover all the cases.
+
+        Test: editing/execCommand/indent-with-style2.html
+
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
+
 2009-12-07  Dmitry Titov  <dimich at chromium.org>
 
         Rubber-stamped by Darin Adler.
diff --git a/WebCore/editing/CompositeEditCommand.cpp b/WebCore/editing/CompositeEditCommand.cpp
index 1617be8..2796690 100644
--- a/WebCore/editing/CompositeEditCommand.cpp
+++ b/WebCore/editing/CompositeEditCommand.cpp
@@ -746,8 +746,9 @@ void CompositeEditCommand::cloneParagraphUnderNewElement(Position& start, Positi
 {
     // First we clone the outerNode
     
-    RefPtr<Node> lastNode = outerNode->cloneNode(isTableElement(outerNode));
-    appendNode(lastNode, blockElement);
+    RefPtr<Node> topNode = outerNode->cloneNode(isTableElement(outerNode));
+    appendNode(topNode, blockElement);
+    RefPtr<Node> lastNode = topNode;
 
     if (start.node() != outerNode) {
         Vector<RefPtr<Node> > ancestors;
@@ -769,12 +770,15 @@ void CompositeEditCommand::cloneParagraphUnderNewElement(Position& start, Positi
     // Handle the case of paragraphs with more than one node,
     // cloning all the siblings until end.node() is reached.
     
-    if (start.node() != end.node()) {
-        for (Node* n = start.node()->nextSibling(); n != NULL; n = n->nextSibling()) {
+    if (start.node() != end.node() && !start.node()->isDescendantOf(end.node())) {
+        for (Node* n = start.node()->traverseNextSibling(outerNode); n; n = n->nextSibling()) {
+            if (n->parentNode() != start.node()->parentNode())
+                lastNode = topNode->firstChild();
+
             RefPtr<Node> clonedNode = n->cloneNode(true);
             insertNodeAfter(clonedNode, lastNode);
             lastNode = clonedNode.release();
-            if (n == end.node())
+            if (n == end.node() || end.node()->isDescendantOf(n))
                 break;
         }
     }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list