Reviewed by mjs
authorjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Oct 2006 19:01:33 +0000 (19:01 +0000)
committerjusting <justing@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Oct 2006 19:01:33 +0000 (19:01 +0000)
        <rdar://problem/4760612>
        TOT REGRESSION: Repro assertion failure when forwarding draft in Range::compareBoundaryPoints

        No layout test possible, attributedStringFrom:(DOMNode*)...etc isn't available to DRT.

        * dom/Range.cpp:
        (WebCore::Range::boundaryPointsValid): compareBoundaryPoints asserts that the incoming
        positions are non-null since most of it's callers would be in a bad state if the positions
        were null.  boundaryPointsValid, which calls compareBoundaryPoints, is an exception.
        Instead of removing the assert I've added nil checks in boundaryPointsValid, to keep it
        from entering compareBoundaryPoints and hitting the assert.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16740 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/dom/Range.cpp

index ccd790170e66e4ee18483a906340c0aa6f61c8a7..32425ccd8bdbac89258472df207de161a1def831 100644 (file)
@@ -1,3 +1,19 @@
+2006-10-03  Justin Garcia  <justin.garcia@apple.com>
+
+        Reviewed by mjs
+        
+        <rdar://problem/4760612>
+        TOT REGRESSION: Repro assertion failure when forwarding draft in Range::compareBoundaryPoints
+        
+        No layout test possible, attributedStringFrom:(DOMNode*)...etc isn't available to DRT.
+        
+        * dom/Range.cpp:
+        (WebCore::Range::boundaryPointsValid): compareBoundaryPoints asserts that the incoming 
+        positions are non-null since most of it's callers would be in a bad state if the positions 
+        were null.  boundaryPointsValid, which calls compareBoundaryPoints, is an exception.  
+        Instead of removing the assert I've added nil checks in boundaryPointsValid, to keep it 
+        from entering compareBoundaryPoints and hitting the assert.
+
 2006-10-03  Adele Peterson  <adele@apple.com>
 
         Reviewed by Geoff.
index 1383f7854612347653067a5d0034e8c9be03e0cb..11c4156f443e04a70862fc0959c65a947f665cbc 100644 (file)
@@ -527,7 +527,7 @@ short Range::compareBoundaryPoints( const Position &a, const Position &b )
 
 bool Range::boundaryPointsValid() const
 {
-    return compareBoundaryPoints(m_startContainer.get(), m_startOffset, m_endContainer.get(), m_endOffset) <= 0;
+    return m_startContainer && m_endContainer && compareBoundaryPoints(m_startContainer.get(), m_startOffset, m_endContainer.get(), m_endOffset) <= 0;
 }
 
 void Range::deleteContents(ExceptionCode& ec) {