Reviewed by Richard.
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Feb 2005 01:38:31 +0000 (01:38 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Feb 2005 01:38:31 +0000 (01:38 +0000)
        <rdar://problem/3991652> REGRESSION (Mail): Deleting entire line in reply deletes extra blank line and moves insertion point

        * WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView _deleteRange:killRing:prepend:smartDeleteOK:isTypingAction:]):
        (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]):
        (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]):
        (-[WebHTMLView selectToMark:]):
        (-[WebHTMLView swapWithMark:]):
        (-[WebHTMLView transpose:]):
        (-[WebHTMLView _selectMarkedText]):
        (-[WebHTMLView _selectRangeInMarkedText:]):
        Adopt new default affinity of NSSelectionAffinityDownstream as of <rdar://problem/3937447>.

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

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

index 88523498a549f6c3140f719c75ef2c4cd8abccde..4de4aaf932c4bbd10850792104656cacecd172d4 100644 (file)
@@ -1,3 +1,20 @@
+2005-02-10  David Harrison  <harrison@apple.com>
+
+        Reviewed by Richard.
+
+        <rdar://problem/3991652> REGRESSION (Mail): Deleting entire line in reply deletes extra blank line and moves insertion point
+        
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView _deleteRange:killRing:prepend:smartDeleteOK:isTypingAction:]):
+        (-[WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:]):
+        (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]):
+        (-[WebHTMLView selectToMark:]):
+        (-[WebHTMLView swapWithMark:]):
+        (-[WebHTMLView transpose:]):
+        (-[WebHTMLView _selectMarkedText]):
+        (-[WebHTMLView _selectRangeInMarkedText:]):
+        Adopt new default affinity of NSSelectionAffinityDownstream as of <rdar://problem/3937447>.
+        
 2005-02-10  Darin Adler  <darin@apple.com>
 
         Reviewed by Harrison.
index b6c9d5512c69eeea8eb53a61d54cb1b39b2342b0..2641a76a2a5bb24ad1cbebf0efc66990e86419cf 100644 (file)
@@ -503,7 +503,7 @@ void *_NSSoftLinkingGetFrameworkFuncPtr(NSString *inUmbrellaFrameworkName,
         return;
     }
     WebBridge *bridge = [self _bridge];
-    [bridge setSelectedDOMRange:range affinity:NSSelectionAffinityUpstream];
+    [bridge setSelectedDOMRange:range affinity:NSSelectionAffinityDownstream];
     [self _handleKillRing:killRing prepend:prepend];
     BOOL smartDelete = smartDeleteOK ? [self _canSmartCopyOrDelete] : NO;
     if (isTypingAction) {
@@ -1171,7 +1171,7 @@ static WebHTMLView *lastHitView = nil;
             // Select the image when it is dragged. This allows the image to be moved via MoveSelectionCommandImpl and this matches NSTextView's behavior.
             DOMHTMLElement *imageElement = [element objectForKey:WebElementDOMNodeKey];
             ASSERT(imageElement != nil);
-            [webView setSelectedDOMRange:[[[self _bridge] DOMDocument] _createRangeWithNode:imageElement] affinity:NSSelectionAffinityUpstream];
+            [webView setSelectedDOMRange:[[[self _bridge] DOMDocument] _createRangeWithNode:imageElement] affinity:NSSelectionAffinityDownstream];
             _private->draggingImageURL = [imageURL retain];
             source = [pasteboard _web_declareAndWriteDragImage:image
                                                            URL:linkURL ? linkURL : imageURL
@@ -4095,13 +4095,13 @@ NSStrokeColorAttributeName        /* NSColor, default nil: same as foreground co
             case WebSelectForward:
             case WebSelectRight:
                 [self _handleKillRing:killRing prepend:NO];
-                [bridge setSelectedDOMRange:range affinity:NSSelectionAffinityUpstream];
+                [bridge setSelectedDOMRange:range affinity:NSSelectionAffinityDownstream];
                 [bridge forwardDeleteKeyPressedWithSmartDelete:NO];
                 break;
             case WebSelectBackward:
             case WebSelectLeft:
                 [self _handleKillRing:killRing prepend:YES];
-                [bridge setSelectedDOMRange:range affinity:NSSelectionAffinityUpstream];
+                [bridge setSelectedDOMRange:range affinity:NSSelectionAffinityDownstream];
                 [bridge deleteKeyPressedWithSmartDelete:NO];
                 break;
         }
@@ -4375,7 +4375,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
     }
     DOMRange *selection = [self _selectedRange];
     @try {
-        [bridge setSelectedDOMRange:unionDOMRanges(mark, selection) affinity:NSSelectionAffinityUpstream];
+        [bridge setSelectedDOMRange:unionDOMRanges(mark, selection) affinity:NSSelectionAffinityDownstream];
     } @catch (NSException *exception) {
         NSBeep();
     }
@@ -4391,7 +4391,7 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
     }
     DOMRange *selection = [self _selectedRange];
     @try {
-        [bridge setSelectedDOMRange:mark affinity:NSSelectionAffinityUpstream];
+        [bridge setSelectedDOMRange:mark affinity:NSSelectionAffinityDownstream];
     } @catch (NSException *exception) {
         NSBeep();
         return;
@@ -4415,10 +4415,10 @@ static DOMRange *unionDOMRanges(DOMRange *a, DOMRange *b)
     }
     NSString *transposed = [[characters substringFromIndex:1] stringByAppendingString:[characters substringToIndex:1]];
     WebView *webView = [self _webView];
-    if (![[webView _editingDelegateForwarder] webView:webView shouldChangeSelectedDOMRange:[self _selectedRange] toDOMRange:r affinity:NSSelectionAffinityUpstream stillSelecting:NO]) {
+    if (![[webView _editingDelegateForwarder] webView:webView shouldChangeSelectedDOMRange:[self _selectedRange] toDOMRange:r affinity:NSSelectionAffinityDownstream stillSelecting:NO]) {
         return;
     }
-    [bridge setSelectedDOMRange:r affinity:NSSelectionAffinityUpstream];
+    [bridge setSelectedDOMRange:r affinity:NSSelectionAffinityDownstream];
     if ([self _shouldReplaceSelectionWithText:transposed givenAction:WebViewInsertActionTyped]) {
         [bridge replaceSelectionWithText:transposed selectReplacement:NO smartReplace:NO];
     }
@@ -4761,7 +4761,7 @@ static NSArray *validAttributes = nil;
     if ([self hasMarkedText]) {
        WebBridge *bridge = [self _bridge];
        DOMRange *markedTextRange = [bridge markedTextDOMRange];
-       [bridge setSelectedDOMRange:markedTextRange affinity:NSSelectionAffinityUpstream];
+       [bridge setSelectedDOMRange:markedTextRange affinity:NSSelectionAffinityDownstream];
     }
 }
 
@@ -4781,7 +4781,7 @@ static NSArray *validAttributes = nil;
     [selectedRange setStart:[markedTextRange startContainer] :selectionStart];
     [selectedRange setEnd:[markedTextRange startContainer] :selectionEnd];
 
-    [bridge setSelectedDOMRange:selectedRange affinity:NSSelectionAffinityUpstream];
+    [bridge setSelectedDOMRange:selectedRange affinity:NSSelectionAffinityDownstream];
 }
 
 - (void)_extractAttributes:(NSArray **)a ranges:(NSArray **)r fromAttributedString:(NSAttributedString *)string