[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-142-g786665c

enrica at apple.com enrica at apple.com
Mon Dec 27 16:25:23 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit ca1c95ff0430d54a1e46ad2f2574bb0d724cffae
Author: enrica at apple.com <enrica at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 20 22:51:20 2010 +0000

    Crash at WebCore::SplitElementCommand::SplitElementCommand
    https://bugs.webkit.org/show_bug.cgi?id=51278
    <rdar://problem/7347139>
    
    Reviewed by Darin Adler.
    
    WebCore:
    
    Executing outdent command on an inline blockquote that is
    not the first element in a block causes a crash.
    The fix consists in chaging the was the start of block is
    calculated in case of the inline blockquote.
    
    Test: editing/execCommand/outdent-inline-blockquote.html
          editing/execCommand/outdent-inline-list.html
    
    * editing/IndentOutdentCommand.cpp:
    (WebCore::IndentOutdentCommand::outdentParagraph):
    
    LayoutTests:
    
    * editing/execCommand/outdent-inline-blockquote-expected.txt: Added.
    * editing/execCommand/outdent-inline-blockquote.html: Added.
    * editing/execCommand/outdent-inline-list-expected.txt: Added.
    * editing/execCommand/outdent-inline-list.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74369 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e9bd05a..6a1e5d7 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-12-20  Enrica Casucci  <enrica at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Crash at WebCore::SplitElementCommand::SplitElementCommand
+        https://bugs.webkit.org/show_bug.cgi?id=51278
+        <rdar://problem/7347139> 
+
+        * editing/execCommand/outdent-inline-blockquote-expected.txt: Added.
+        * editing/execCommand/outdent-inline-blockquote.html: Added.
+        * editing/execCommand/outdent-inline-list-expected.txt: Added.
+        * editing/execCommand/outdent-inline-list.html: Added.
+
 2010-12-20  Oliver Hunt  <oliver at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/editing/execCommand/outdent-inline-blockquote-expected.txt b/LayoutTests/editing/execCommand/outdent-inline-blockquote-expected.txt
new file mode 100644
index 0000000..376cc99
--- /dev/null
+++ b/LayoutTests/editing/execCommand/outdent-inline-blockquote-expected.txt
@@ -0,0 +1,3 @@
+
+Executing Outdent on an inline blockquote that is not the first element in the document should not crash.
+Test passed: no crash
diff --git a/LayoutTests/editing/execCommand/outdent-inline-blockquote.html b/LayoutTests/editing/execCommand/outdent-inline-blockquote.html
new file mode 100644
index 0000000..dc62503
--- /dev/null
+++ b/LayoutTests/editing/execCommand/outdent-inline-blockquote.html
@@ -0,0 +1,24 @@
+<html>
+<body contenteditable="true">
+<br>
+<blockquote id="test" style="display: inline">Executing Outdent on an inline blockquote that is not the first element in the document should not crash.</blockquote>
+<p id="console"></p>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+function log(message) {
+    var console = document.getElementById("console");
+    var text = document.createTextNode(message);
+    console.appendChild(text);
+}
+
+var s = window.getSelection();
+var p1 = document.getElementById("test");
+s.setPosition(p1, 0);
+document.execCommand("Outdent", false, 0);
+log("Test passed: no crash");
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/editing/execCommand/outdent-inline-list-expected.txt b/LayoutTests/editing/execCommand/outdent-inline-list-expected.txt
new file mode 100644
index 0000000..30ddfc6
--- /dev/null
+++ b/LayoutTests/editing/execCommand/outdent-inline-list-expected.txt
@@ -0,0 +1,8 @@
+
+one
+two
+three
+one
+two
+three
+Test1 passed: no crash Test2 passed: no crash
diff --git a/LayoutTests/editing/execCommand/outdent-inline-list.html b/LayoutTests/editing/execCommand/outdent-inline-list.html
new file mode 100644
index 0000000..39071ed
--- /dev/null
+++ b/LayoutTests/editing/execCommand/outdent-inline-list.html
@@ -0,0 +1,29 @@
+<html>
+<body contenteditable="true">
+<br>
+<ol><li id="test1" style="display: inline">one</li><li>two</li><li>three</li></ol>
+<ul><li id="test2" style="display: inline">one</li><li>two</li><li>three</li></ul>
+<p id="console"></p>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+function log(message) {
+    var console = document.getElementById("console");
+    var text = document.createTextNode(message);
+    console.appendChild(text);
+}
+
+var s = window.getSelection();
+var p = document.getElementById("test1");
+s.setPosition(p, 0);
+document.execCommand("Outdent", false, 0);
+log("Test1 passed: no crash ");
+var p = document.getElementById("test2");
+s.setPosition(p, 0);
+document.execCommand("Outdent", false, 0);
+log("Test2 passed: no crash");
+
+</script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e2ba1af..1c8fc28 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-12-20  Enrica Casucci  <enrica at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Crash at WebCore::SplitElementCommand::SplitElementCommand
+        https://bugs.webkit.org/show_bug.cgi?id=51278
+        <rdar://problem/7347139> 
+
+        Executing outdent command on an inline blockquote that is
+        not the first element in a block causes a crash.
+        The fix consists in chaging the was the start of block is
+        calculated in case of the inline blockquote.
+        
+        Test: editing/execCommand/outdent-inline-blockquote.html
+              editing/execCommand/outdent-inline-list.html
+
+        * editing/IndentOutdentCommand.cpp:
+        (WebCore::IndentOutdentCommand::outdentParagraph):
+
 2010-12-20  Oliver Hunt  <oliver at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/editing/IndentOutdentCommand.cpp b/WebCore/editing/IndentOutdentCommand.cpp
index 13056d3..13d0f88 100644
--- a/WebCore/editing/IndentOutdentCommand.cpp
+++ b/WebCore/editing/IndentOutdentCommand.cpp
@@ -135,7 +135,9 @@ void IndentOutdentCommand::outdentParagraph()
     
     // The selection is inside a blockquote i.e. enclosingNode is a blockquote
     VisiblePosition positionInEnclosingBlock = VisiblePosition(Position(enclosingNode, 0));
-    VisiblePosition startOfEnclosingBlock = startOfBlock(positionInEnclosingBlock);
+    // If the blockquote is inline, the start of the enclosing block coincides with
+    // positionInEnclosingBlock.
+    VisiblePosition startOfEnclosingBlock = (enclosingNode->renderer() && enclosingNode->renderer()->isInline()) ? positionInEnclosingBlock : startOfBlock(positionInEnclosingBlock);
     VisiblePosition lastPositionInEnclosingBlock = VisiblePosition(Position(enclosingNode, enclosingNode->childNodeCount()));
     VisiblePosition endOfEnclosingBlock = endOfBlock(lastPositionInEnclosingBlock);
     if (visibleStartOfParagraph == startOfEnclosingBlock &&

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list