[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:51:04 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 628d10b06b1e4ddd99a7504768818cc14af6e33e
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 16 21:19:18 2004 +0000

            Reviewed by Hyatt
    
            Fix for this bug:
    
            <rdar://problem/3722153> Random crash while typing (DOM::NodeImpl::parentNode (this=0x0))
    
            * khtml/editing/htmlediting_impl.cpp:
            (khtml::DeleteSelectionCommandImpl::doApply): This check merely makes the code
            more robust. I do not understand how Grant ended up with null start or end
            blocks in the case of his bug report, but by adding two null checks, the code is
            now hardened a bit in case it happens again.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7043 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index a036783..b6eac38 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -2,6 +2,20 @@
 
         Reviewed by Hyatt
 
+        Fix for this bug:
+        
+        <rdar://problem/3722153> Random crash while typing (DOM::NodeImpl::parentNode (this=0x0))
+
+        * khtml/editing/htmlediting_impl.cpp:
+        (khtml::DeleteSelectionCommandImpl::doApply): This check merely makes the code
+        more robust. I do not understand how Grant ended up with null start or end 
+        blocks in the case of his bug report, but by adding two null checks, the code is 
+        now hardened a bit in case it happens again.
+
+2004-07-16  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Hyatt
+
         Fix for these bugs:
 
         <rdar://problem/3730785> Crash when arrow navigation goes to empty table cell
diff --git a/WebCore/khtml/editing/htmlediting_impl.cpp b/WebCore/khtml/editing/htmlediting_impl.cpp
index 0f9b36d..6f6d75b 100644
--- a/WebCore/khtml/editing/htmlediting_impl.cpp
+++ b/WebCore/khtml/editing/htmlediting_impl.cpp
@@ -1188,6 +1188,17 @@ void DeleteSelectionCommandImpl::doApply()
         // after collapsing whitespace, selection is empty...no work to do
         return;
 
+    NodeImpl *startBlock = upstreamStart.node()->enclosingBlockFlowElement();
+    NodeImpl *endBlock = downstreamEnd.node()->enclosingBlockFlowElement();
+    if (!startBlock || !endBlock)
+        // Can't figure out what blocks we're in. This can happen if
+        // the document structure is not what we are expecting, like if
+        // the document has no body element, or if the editable block
+        // has been changed to display: inline. Some day it might
+        // be nice to be able to deal with this, but for now, bail.
+        return;
+    bool startBlockEndBlockAreSiblings = startBlock->parentNode() == endBlock->parentNode();
+
     Position endingPosition;
     bool adjustEndingPositionDownstream = false;
 
@@ -1210,10 +1221,6 @@ void DeleteSelectionCommandImpl::doApply()
         (startRenderedOffset == 0 && downstreamStart.inFirstEditableInContainingEditableBlock());
     bool endAtEndOfBlock = downstreamEnd.isLastRenderedPositionInEditableBlock();
 
-    NodeImpl *startBlock = upstreamStart.node()->enclosingBlockFlowElement();
-    NodeImpl *endBlock = downstreamEnd.node()->enclosingBlockFlowElement();
-    bool startBlockEndBlockAreSiblings = startBlock->parentNode() == endBlock->parentNode();
-
     debugPosition("upstreamStart:       ", upstreamStart);
     debugPosition("downstreamStart:     ", downstreamStart);
     debugPosition("upstreamEnd:         ", upstreamEnd);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list