Reviewed by John.
[WebKit-https.git] / WebKit / WebView.subproj / WebHTMLView.m
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]];
-    [self _selectRangeInMarkedText:newSelRange];
+    if ([self hasMarkedText]) {
+        [self _selectRangeInMarkedText:newSelRange];
+    }
 
     _private->ignoreMarkedTextSelectionChange = NO;
 }