Fixed: <rdar://problem/4032840> REGRESSION (Mail): crash in RemoveNodeCommand after...
authorcblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Mar 2005 01:02:46 +0000 (01:02 +0000)
committercblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Mar 2005 01:02:46 +0000 (01:02 +0000)
        Reviewed by darin.

        * khtml/editing/visible_units.cpp:
        (khtml::endOfParagraph): don't consider text nodes that have no rendered characters

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/editing/visible_units.cpp

index afe7801ae9e99b0784f9b3e54f9ee1011dbf578b..83993b13311984345a2801e090dfc188321f2743 100644 (file)
@@ -1,3 +1,12 @@
+2005-03-04  Chris Blumenberg  <cblu@apple.com>
+
+       Fixed: <rdar://problem/4032840> REGRESSION (Mail): crash in RemoveNodeCommand after pasting attachment at end of message
+
+        Reviewed by darin.
+
+        * khtml/editing/visible_units.cpp:
+        (khtml::endOfParagraph): don't consider text nodes that have no rendered characters
+
 2005-03-04  Richard Williamson   <rjw@apple.com>
 
        Fixed <rdar://problem/4034764> REGRESSION(125-188)Viewing text/plain page and going back/forward corrupts HTML pages (google.com)
index 286370efecf803e425aff60af8517b87df8bf85f..490de017df9131922d7117e2c0542a213c1c7bc1 100644 (file)
@@ -608,7 +608,9 @@ VisiblePosition endOfParagraph(const VisiblePosition &c, EIncludeLineBreak inclu
                 return VisiblePosition(n, 0, DOWNSTREAM);
             break;
         }
-        if (r->isText()) {
+        // FIXME: We avoid returning a position where the renderer can't accept the caret.
+        // We should probably do this in other cases such as startOfParagraph.
+        if (r->isText() && r->caretMaxRenderedOffset() > 0) {
             if (includeLineBreak && !n->isAncestor(startBlock))
                 return VisiblePosition(n, 0, DOWNSTREAM);
             long length = static_cast<RenderText *>(r)->length();