Reviewed by John.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Dec 2004 21:23:07 +0000 (21:23 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Dec 2004 21:23:07 +0000 (21:23 +0000)
<rdar://problem/3912488> Mail throws an exception after backspacing "away" inline input

* WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView setMarkedText:selectedRange:]): Don't try to set a selection if
we end up with no marked text, since that case fails and is unnecessary.

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

WebKit/ChangeLog
WebKit/WebView.subproj/WebHTMLView.m

index a4d22bf382f2538a6c26f8d86b487ed9abafef1a..038db05fec1e1ff8a43d27f128ea304768b8bc22 100644 (file)
@@ -1,3 +1,13 @@
+2004-12-13  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by John.
+
+       <rdar://problem/3912488> Mail throws an exception after backspacing "away" inline input
+        
+       * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView setMarkedText:selectedRange:]): Don't try to set a selection if
+       we end up with no marked text, since that case fails and is unnecessary.
+
 2004-12-14  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Ken.
 2004-12-14  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Ken.
index eba8ce490a66cf1fdfb33f0c9c29894bf9a2cc4d..92921802754b593eb3115dd9271d1d80b00fbb89 100644 (file)
@@ -4361,7 +4361,9 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
 
     [bridge replaceSelectionWithText:text selectReplacement:YES smartReplace:NO];
     [bridge setMarkedTextDOMRange:[self _selectedRange]];
 
     [bridge replaceSelectionWithText:text selectReplacement:YES smartReplace:NO];
     [bridge setMarkedTextDOMRange:[self _selectedRange]];
-    [self _selectRangeInMarkedText:newSelRange];
+    if ([self hasMarkedText]) {
+        [self _selectRangeInMarkedText:newSelRange];
+    }
 
     _private->ignoreMarkedTextSelectionChange = NO;
 }
 
     _private->ignoreMarkedTextSelectionChange = NO;
 }