Reviewed by John.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Feb 2005 18:48:12 +0000 (18:48 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Feb 2005 18:48:12 +0000 (18:48 +0000)
        - fixed <rdar://problem/4019823> Seed: Control-Y doesn't work

        * WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): Call _handleKillRing
        after setting the selection, since it uses the selection to get the text.
        (-[WebHTMLView _insertText:selectInsertedText:]): Check for empty string to avoid an assertion
        on the other side of the bridge when you yank the empty string.

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

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

index 0a4e2b40dc3b383790c6815dc1155d68289846ce..2368c87fd923b8299fd0c1a318c66f60227a675f 100644 (file)
@@ -1,3 +1,15 @@
+2005-02-25  Darin Adler  <darin@apple.com>
+
+        Reviewed by John.
+
+        - fixed <rdar://problem/4019823> Seed: Control-Y doesn't work
+
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): Call _handleKillRing
+        after setting the selection, since it uses the selection to get the text.
+        (-[WebHTMLView _insertText:selectInsertedText:]): Check for empty string to avoid an assertion
+        on the other side of the bridge when you yank the empty string.
+
 2005-02-24  Richard Williamson   <rjw@apple.com>
 
        Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
index 7d3b2aebb1a52f1b457fd9aeb6b303c880f278db..f72e90677da41edad4cbdb47cff079e7b9638621 100644 (file)
@@ -4098,14 +4098,14 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
         switch (direction) {
             case WebSelectForward:
             case WebSelectRight:
-                [self _handleKillRing:killRing prepend:NO];
                 [bridge setSelectedDOMRange:range affinity:NSSelectionAffinityDownstream];
+                [self _handleKillRing:killRing prepend:NO];
                 [bridge forwardDeleteKeyPressedWithSmartDelete:NO];
                 break;
             case WebSelectBackward:
             case WebSelectLeft:
-                [self _handleKillRing:killRing prepend:YES];
                 [bridge setSelectedDOMRange:range affinity:NSSelectionAffinityDownstream];
+                [self _handleKillRing:killRing prepend:YES];
                 [bridge deleteKeyPressedWithSmartDelete:NO];
                 break;
         }
@@ -4865,7 +4865,7 @@ static NSArray *validAttributes = nil;
 
 - (void)_insertText:(NSString *)text selectInsertedText:(BOOL)selectText
 {
-    if (text == nil || (![self _isEditable] && ![self hasMarkedText])) {
+    if (text == nil || [text length] == 0 || (![self _isEditable] && ![self hasMarkedText])) {
         return;
     }