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

enrica at apple.com enrica at apple.com
Wed Apr 7 23:18:49 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 9a4d39505a3be9496ba8ba3c079d073a046e1566
Author: enrica at apple.com <enrica at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 3 01:06:26 2009 +0000

    Safari crashes when calling execCommand on formatted html in special case
    <rdar://problem/7318656>
    https://bugs.webkit.org/show_bug.cgi?id=31023
    
    Reviewed by Adele Peterson and Dan Bernstein.
    
    WebCore:
    
    Test: editing/execCommand/align-in-span.html
    
    * rendering/RenderObject.cpp:
    (WebCore::RenderObject::containingBlock): Modified comment on containingBlock returning NULL.
    * rendering/RenderText.cpp:
    (WebCore::RenderText::setSelectionState): Added check for NULL return from containingBlock,
    since it is possible when dealing with orphaned trees.
    
    LayoutTests:
    
    * editing/execCommand/align-in-span-expected.txt: Added.
    * editing/execCommand/align-in-span.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50433 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 6b88ef4..875a1b0 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2009-11-02  Enrica Casucci  <enrica at apple.com>
+
+        Reviewed by Adele Peterson and Dan Bernstein.
+
+        Safari crashes when calling execCommand on formatted html in special case
+        <rdar://problem/7318656>
+        https://bugs.webkit.org/show_bug.cgi?id=31023
+
+        * editing/execCommand/align-in-span-expected.txt: Added.
+        * editing/execCommand/align-in-span.html: Added.
+
 2009-11-02  Chris Marrin  <cmarrin at apple.com>
 
         Reviewed by Oliver Hunt.
diff --git a/LayoutTests/editing/execCommand/align-in-span-expected.txt b/LayoutTests/editing/execCommand/align-in-span-expected.txt
new file mode 100644
index 0000000..4d8e806
--- /dev/null
+++ b/LayoutTests/editing/execCommand/align-in-span-expected.txt
@@ -0,0 +1,4 @@
+Line 1. 
+Select all text in this line and use justify command.
+Line 3.
+
diff --git a/LayoutTests/editing/execCommand/align-in-span.html b/LayoutTests/editing/execCommand/align-in-span.html
new file mode 100755
index 0000000..88249bd
--- /dev/null
+++ b/LayoutTests/editing/execCommand/align-in-span.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+<script type="text/javascript">
+
+function selectAndJustify()
+{
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+
+    var elem = document.getElementById("test");
+    var selection = window.getSelection();
+    selection.setBaseAndExtent(elem, 2, elem, 6);
+    document.execCommand('JustifyCenter', false, null);
+}
+
+</script>
+</head>
+
+<body>
+    <span id="test" contenteditable="true" >
+        Line 1.
+        <br>
+        <b>Select all text in this line and use justify command.</b>
+        <br>
+        Line 3.
+    </span>
+</body>
+<script>
+selectAndJustify();
+</script>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 962ba8e..e3cccb0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2009-11-02  Enrica Casucci  <enrica at apple.com>
+
+        Reviewed by Adele Peterson and Dan Bernstein.
+
+        Safari crashes when calling execCommand on formatted html in special case
+        <rdar://problem/7318656>
+        https://bugs.webkit.org/show_bug.cgi?id=31023
+
+        Test: editing/execCommand/align-in-span.html
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::containingBlock): Modified comment on containingBlock returning NULL.
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::setSelectionState): Added check for NULL return from containingBlock,
+        since it is possible when dealing with orphaned trees.
+
 2009-11-02  Chris Marrin  <cmarrin at apple.com>
 
         Reviewed by Oliver Hunt.
diff --git a/WebCore/rendering/RenderObject.cpp b/WebCore/rendering/RenderObject.cpp
index e451c30..3dc565c 100644
--- a/WebCore/rendering/RenderObject.cpp
+++ b/WebCore/rendering/RenderObject.cpp
@@ -640,7 +640,7 @@ RenderBlock* RenderObject::containingBlock() const
     }
 
     if (!o || !o->isRenderBlock())
-        return 0; // Probably doesn't happen any more, but leave just in case. -dwh
+        return 0; // This can still happen in case of an orphaned tree
 
     return toRenderBlock(o);
 }
diff --git a/WebCore/rendering/RenderText.cpp b/WebCore/rendering/RenderText.cpp
index 40c3d75..a4f53a2 100644
--- a/WebCore/rendering/RenderText.cpp
+++ b/WebCore/rendering/RenderText.cpp
@@ -813,7 +813,9 @@ void RenderText::setSelectionState(SelectionState state)
         }
     }
 
-    containingBlock()->setSelectionState(state);
+    // The returned value can be null in case of an orphaned tree.
+    if (RenderBlock* cb = containingBlock())
+        cb->setSelectionState(state);
 }
 
 void RenderText::setTextWithOffset(PassRefPtr<StringImpl> text, unsigned offset, unsigned len, bool force)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list