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

eric at webkit.org eric at webkit.org
Thu Apr 8 00:51:18 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 1cb44407a77076806d5ef032c70f9c4c64fbd23f
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 29 06:25:16 2009 +0000

    2009-12-28  Mike Moretti  <webkit9 at mordent.com>
    
            Reviewed by Darin Adler.
    
            Fix bug 28245 - problem with inserting a span into a long text block causing a crash because of a null string
    
            Test: fast/dom/insert-span-into-long-text-bug-28245.html
    
            * rendering/RenderBlockLineLayout.cpp:
            (WebCore::RenderBlock::findNextLineBreak):
    2009-12-28  Mike Moretti  <webkit9 at mordent.com>
    
            Reviewed by Darin Adler.
    
            Fix bug 28245 - problem with inserting a span into a long text block causing a crash because of a null string
    
            * fast/dom/insert-span-into-long-text-bug-28245-expected.txt: Added.
            * fast/dom/insert-span-into-long-text-bug-28245.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52607 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 2919287..c6c5ade 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2009-12-28  Mike Moretti  <webkit9 at mordent.com>
+
+        Reviewed by Darin Adler.
+
+        Fix bug 28245 - problem with inserting a span into a long text block causing a crash because of a null string
+
+        * fast/dom/insert-span-into-long-text-bug-28245-expected.txt: Added.
+        * fast/dom/insert-span-into-long-text-bug-28245.html: Added.
+
 2009-12-28  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
 
         Skip test that is failing since it was checked in, and some tests
diff --git a/LayoutTests/fast/dom/insert-span-into-long-text-bug-28245-expected.txt b/LayoutTests/fast/dom/insert-span-into-long-text-bug-28245-expected.txt
new file mode 100644
index 0000000..08ce065
--- /dev/null
+++ b/LayoutTests/fast/dom/insert-span-into-long-text-bug-28245-expected.txt
@@ -0,0 +1,7 @@
+This tests that inserting a span into a selection of a div with lots of non-word-broken characters doesn't crash.
+____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
+<div>____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
+</div>
+<div><span></span>____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
+</div>
+
diff --git a/LayoutTests/fast/dom/insert-span-into-long-text-bug-28245.html b/LayoutTests/fast/dom/insert-span-into-long-text-bug-28245.html
new file mode 100644
index 0000000..dd3737e
--- /dev/null
+++ b/LayoutTests/fast/dom/insert-span-into-long-text-bug-28245.html
@@ -0,0 +1,40 @@
+<html>
+<head>
+<style>
+#highlighted
+{
+white-space: pre-wrap;
+}
+</style>
+  <script>
+    function debug(str) {
+        pre = document.getElementById('console');
+        pre.appendChild(document.createTextNode(str + '\n'));
+    }
+
+    function runTest() {
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText()
+
+        var str = '____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________'
+        var div = document.getElementById('highlighted');
+        div.innerHTML = '<div>' + str + '\n</div>'
+        debug(div.innerHTML);
+
+        // Test crash
+        var sel = getSelection();
+        sel.setPosition(div.firstChild, 0);
+    
+        var range = sel.getRangeAt(0);
+        var span = document.createElement('SPAN');
+        range.insertNode(span);
+        debug(div.innerHTML);
+    }
+  </script>
+</head>
+<body onload="runTest()">
+  This tests that inserting a span into a selection of a div with lots of non-word-broken characters doesn't crash.
+  <div id="highlighted"></div>
+  <pre id="console"></pre>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f3bcb9f..acfca97 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,14 @@
+2009-12-28  Mike Moretti  <webkit9 at mordent.com>
+
+        Reviewed by Darin Adler.
+
+        Fix bug 28245 - problem with inserting a span into a long text block causing a crash because of a null string
+
+        Test: fast/dom/insert-span-into-long-text-bug-28245.html
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlock::findNextLineBreak):
+
 2009-12-28  Gustavo Noronha Silva  <gustavo.noronha at collabora.co.uk>
 
         Rubber-stamped by Xan Lopez.
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index 4e76fcb..f05d724 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -1927,7 +1927,7 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
                             }
                         }
                         if (lineWasTooWide || w + tmpW > width) {
-                            if (lBreak.obj && shouldPreserveNewline(lBreak.obj) && lBreak.obj->isText() && !toRenderText(lBreak.obj)->isWordBreak() && toRenderText(lBreak.obj)->characters()[lBreak.pos] == '\n') {
+                            if (lBreak.obj && shouldPreserveNewline(lBreak.obj) && lBreak.obj->isText() && toRenderText(lBreak.obj)->textLength() && !toRenderText(lBreak.obj)->isWordBreak() && toRenderText(lBreak.obj)->characters()[lBreak.pos] == '\n') {
                                 if (!stoppedIgnoringSpaces && pos > 0) {
                                     // We need to stop right before the newline and then start up again.
                                     addMidpoint(lineMidpointState, InlineIterator(0, o, pos - 1)); // Stop

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list