[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:50:45 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit c054edc693021b28db0e15c14fde56949e2651a1
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jul 15 17:20:50 2004 +0000

            Reviewed by John
    
            Fix for this bug:
            <rdar://problem/3587601> reproducible assertion failure in Blot deleting text, then image at Yahoo.com
    
            * khtml/editing/htmlediting_impl.cpp:
            (khtml::DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): Relax assertion
            that nodes are text nodes during the walk of eligible nodes that could possibly be
            deleted. Change the assertion to an conditional check for text nodes. We may have
            unrendered nodes in the mix here (as is the case in the bug where the assertion
            failed on an AREA element), and the conditional check is sufficient to
            skip them while leaving the delete logic we want unperturbed.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7033 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 2ef0919..585978f 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,18 @@
+2004-07-15  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by John
+
+        Fix for this bug:
+        <rdar://problem/3587601> reproducible assertion failure in Blot deleting text, then image at Yahoo.com
+        
+        * khtml/editing/htmlediting_impl.cpp:
+        (khtml::DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace): Relax assertion
+        that nodes are text nodes during the walk of eligible nodes that could possibly be
+        deleted. Change the assertion to an conditional check for text nodes. We may have 
+        unrendered nodes in the mix here (as is the case in the bug where the assertion
+        failed on an AREA element), and the conditional check is sufficient to
+        skip them while leaving the delete logic we want unperturbed. 
+
 2004-07-14  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by John
diff --git a/WebCore/khtml/editing/htmlediting_impl.cpp b/WebCore/khtml/editing/htmlediting_impl.cpp
index 94760db..0f9b36d 100644
--- a/WebCore/khtml/editing/htmlediting_impl.cpp
+++ b/WebCore/khtml/editing/htmlediting_impl.cpp
@@ -1010,39 +1010,40 @@ Position DeleteCollapsibleWhitespaceCommandImpl::deleteWhitespace(const Position
     Position endingPosition = upstream;
     
     while (it.current() != downstream) {
-
         Position next = it.peekNext();
         if (next.node() != deleteStart.node()) {
-            ASSERT(deleteStart.node()->isTextNode());
-            TextImpl *textNode = static_cast<TextImpl *>(deleteStart.node());
-            unsigned long count = it.current().offset() - deleteStart.offset();
-            if (count == textNode->length()) {
-                LOG(Editing, "   removeNodeAndPrune 1: [%p]\n", textNode);
-                if (textNode == endingPosition.node())
-                    endingPosition = Position(next.node(), next.node()->caretMinOffset());
-                removeNodeAndPrune(textNode);
-            }
-            else {
-                LOG(Editing, "   deleteText 1: [%p:%d:%d:%d]\n", textNode, textNode->length(), deleteStart.offset(), it.current().offset() - deleteStart.offset());
-                deleteText(textNode, deleteStart.offset(), count);
+            if (deleteStart.node()->isTextNode()) {
+                TextImpl *textNode = static_cast<TextImpl *>(deleteStart.node());
+                unsigned long count = it.current().offset() - deleteStart.offset();
+                if (count == textNode->length()) {
+                    LOG(Editing, "   removeNodeAndPrune 1: [%p]\n", textNode);
+                    if (textNode == endingPosition.node())
+                        endingPosition = Position(next.node(), next.node()->caretMinOffset());
+                    removeNodeAndPrune(textNode);
+                }
+                else {
+                    LOG(Editing, "   deleteText 1: [%p:%d:%d:%d]\n", textNode, textNode->length(), deleteStart.offset(), it.current().offset() - deleteStart.offset());
+                    deleteText(textNode, deleteStart.offset(), count);
+                }
             }
             deleteStart = next;
         }
         else if (next == downstream) {
-            ASSERT(deleteStart.node() == downstream.node());
-            ASSERT(downstream.node()->isTextNode());
-            TextImpl *textNode = static_cast<TextImpl *>(deleteStart.node());
-            unsigned long count = downstream.offset() - deleteStart.offset();
-            ASSERT(count <= textNode->length());
-            if (count == textNode->length()) {
-                LOG(Editing, "   removeNodeAndPrune 2: [%p]\n", textNode);
-                removeNodeAndPrune(textNode);
-            }
-            else {
-                LOG(Editing, "   deleteText 2: [%p:%d:%d:%d]\n", textNode, textNode->length(), deleteStart.offset(), count);
-                deleteText(textNode, deleteStart.offset(), count);
-                m_charactersDeleted = count;
-                endingPosition = Position(downstream.node(), downstream.offset() - m_charactersDeleted);
+            if (downstream.node()->isTextNode()) {
+                ASSERT(deleteStart.node() == downstream.node());
+                TextImpl *textNode = static_cast<TextImpl *>(deleteStart.node());
+                unsigned long count = downstream.offset() - deleteStart.offset();
+                ASSERT(count <= textNode->length());
+                if (count == textNode->length()) {
+                    LOG(Editing, "   removeNodeAndPrune 2: [%p]\n", textNode);
+                    removeNodeAndPrune(textNode);
+                }
+                else {
+                    LOG(Editing, "   deleteText 2: [%p:%d:%d:%d]\n", textNode, textNode->length(), deleteStart.offset(), count);
+                    deleteText(textNode, deleteStart.offset(), count);
+                    m_charactersDeleted = count;
+                    endingPosition = Position(downstream.node(), downstream.offset() - m_charactersDeleted);
+                }
             }
         }
         

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list