Changeset 10612 in webkit
- Timestamp:
- Sep 24, 2005, 3:58:19 AM (20 years ago)
- Location:
- trunk/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/WebKit/ChangeLog ¶
r10606 r10612 1 2005-09-24 Alexey Proskuryakov <ap@nypop.com> 2 3 Tweaked, reviewed, and landed by Darin. 4 5 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4394 6 Mouse clicks ignored in inline input areas 7 8 * WebView.subproj/WebHTMLView.m: 9 (-[NSArray mouseDown:]): Removed misleading comment and added code to send mouse event to input manager. 10 (-[NSArray mouseDragged:]): Added code to send mouse event to input manager. 11 (-[NSArray mouseUp:]): Ditto. 12 (-[WebHTMLView _discardMarkedText]): Umnmark text before calling markedTextAbandoned: to match behavior 13 of NSTextView (not sure why we did things in the opposite order before). 14 (-[WebHTMLView _updateSelectionForInputManager]): Ditto. 15 16 - unrelated tweak 17 18 * WebView.subproj/WebView.m: 19 (-[WebView _performTextSizingSelector:withObject:onTrackingDocs:selForNonTrackingDocs:newScaleFactor:]): 20 Fix typecast that used ... for no good reason. 21 1 22 2005-09-23 Duncan Wilcox <duncan@mclink.it> 2 23 -
TabularUnified trunk/WebKit/WebView.subproj/WebHTMLView.m ¶
r10606 r10612 1449 1449 // Guarantee that the autoscroll timer is invalidated, even if we don't receive 1450 1450 // a mouse up event. 1451 1451 BOOL isStillDown = WKMouseIsDown(); 1452 1452 if (!isStillDown){ 1453 1453 [self _stopAutoscrollTimer]; … … 2214 2214 // Ensure that we will receive mouse move events. Is this the best place to put this? 2215 2215 [[self window] setAcceptsMouseMovedEvents: YES]; 2216 2216 WKSetNSWindowShouldPostEventNotifications([self window], YES); 2217 2217 2218 2218 if (!_private->needsLayout) { … … 2581 2581 [self _setMouseDownEvent:event]; 2582 2582 2583 // TEXTINPUT: if there is marked text and the current input 2584 // manager wants to handle mouse events, we need to make sure to 2585 // pass it to them. If not, then we need to notify the input 2586 // manager when the marked text is abandoned (user clicks outside 2587 // the marked area) 2583 NSInputManager *currentInputManager = [NSInputManager currentInputManager]; 2584 if ([currentInputManager wantsToHandleMouseEvents] && [currentInputManager handleMouseEvent:event]) 2585 goto done; 2588 2586 2589 2587 [_private->compController endRevertingChange:NO moveLeft:NO]; … … 2602 2600 } 2603 2601 2602 done: 2604 2603 [_private->firstResponderAtMouseDownTime release]; 2605 2604 _private->firstResponderAtMouseDownTime = nil; … … 2631 2630 - (void)mouseDragged:(NSEvent *)event 2632 2631 { 2632 NSInputManager *currentInputManager = [NSInputManager currentInputManager]; 2633 if ([currentInputManager wantsToHandleMouseEvents] && [currentInputManager handleMouseEvent:event]) 2634 return; 2635 2633 2636 [self retain]; 2634 2635 // TEXTINPUT: if there is marked text and the current input 2636 // manager wants to handle mouse events, we need to make sure to 2637 // pass it to them. 2638 2639 if (!_private->ignoringMouseDraggedEvents) { 2637 2638 if (!_private->ignoringMouseDraggedEvents) 2640 2639 [[self _bridge] mouseDragged:event]; 2641 } 2642 2640 2643 2641 [self release]; 2644 2642 } … … 2859 2857 - (void)mouseUp:(NSEvent *)event 2860 2858 { 2861 // TEXTINPUT: if there is marked text and the current input2862 // manager wants to handle mouse events, we need to make sure to2863 // pass it to them.2859 NSInputManager *currentInputManager = [NSInputManager currentInputManager]; 2860 if ([currentInputManager wantsToHandleMouseEvents] && [currentInputManager handleMouseEvent:event]) 2861 return; 2864 2862 2865 2863 [self retain]; 2866 2864 2867 2865 [self _stopAutoscrollTimer]; 2868 2866 [[self _bridge] mouseUp:event]; … … 5000 4998 - (void)_extractAttributes:(NSArray **)a ranges:(NSArray **)r fromAttributedString:(NSAttributedString *)string 5001 4999 { 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5000 int length = [[string string] length]; 5001 int i = 0; 5002 NSMutableArray *attributes = [NSMutableArray array]; 5003 NSMutableArray *ranges = [NSMutableArray array]; 5004 while (i < length) { 5005 NSRange effectiveRange; 5006 NSDictionary *attrs = [string attributesAtIndex:i longestEffectiveRange:&effectiveRange inRange:NSMakeRange(i,length - i)]; 5007 [attributes addObject:attrs]; 5008 [ranges addObject:[NSValue valueWithRange:effectiveRange]]; 5009 i = effectiveRange.location + effectiveRange.length; 5010 } 5011 *a = attributes; 5012 *r = ranges; 5015 5013 } 5016 5014 … … 5071 5069 { 5072 5070 if (![self hasMarkedText]) 5073 5071 return; 5074 5072 5075 5073 _private->ignoreMarkedTextSelectionChange = YES; 5076 5074 5077 5075 [self _selectMarkedText]; 5076 [self unmarkText]; 5078 5077 [[NSInputManager currentInputManager] markedTextAbandoned:self]; 5079 [self unmarkText];5080 5078 // FIXME: Should we be calling the delegate here? 5081 5079 [[self _bridge] deleteSelectionWithSmartDelete:NO]; … … 5091 5089 5092 5090 if (![self _shouldReplaceSelectionWithText:text givenAction:WebViewInsertActionTyped]) { 5093 5094 5091 [self _discardMarkedText]; 5092 return; 5095 5093 } 5096 5094 … … 5112 5110 NSString *text; 5113 5111 if ([string isKindOfClass:[NSAttributedString class]]) { 5114 5112 text = [string string]; 5115 5113 // we don't yet support inserting an attributed string but input methods 5116 5114 // don't appear to require this. 5117 5115 } else { 5118 5116 text = string; 5119 5117 } 5120 5118 … … 5131 5129 5132 5130 if ([selection startContainer] != [markedTextRange startContainer]) 5133 5131 return NO; 5134 5132 5135 5133 if ([selection endContainer] != [markedTextRange startContainer]) 5136 5134 return NO; 5137 5135 5138 5136 if ([selection startOffset] < [markedTextRange startOffset]) 5139 5137 return NO; 5140 5138 5141 5139 if ([selection endOffset] > [markedTextRange endOffset]) 5142 5140 return NO; 5143 5141 5144 5142 return YES; … … 5148 5146 { 5149 5147 if (![self hasMarkedText] || _private->ignoreMarkedTextSelectionChange) 5150 5148 return; 5151 5149 5152 5150 if ([self _selectionIsInsideMarkedText]) { 5153 5154 5155 5156 5157 5158 5159 5160 5151 DOMRange *selection = [self _selectedRange]; 5152 DOMRange *markedTextDOMRange = [[self _bridge] markedTextDOMRange]; 5153 5154 unsigned markedSelectionStart = [selection startOffset] - [markedTextDOMRange startOffset]; 5155 unsigned markedSelectionLength = [selection endOffset] - [selection startOffset]; 5156 NSRange newSelectionRange = NSMakeRange(markedSelectionStart, markedSelectionLength); 5157 5158 [[NSInputManager currentInputManager] markedTextSelectionChanged:newSelectionRange client:self]; 5161 5159 } else { 5162 [[NSInputManager currentInputManager] markedTextAbandoned:self];5163 [self unmarkText];5160 [self unmarkText]; 5161 [[NSInputManager currentInputManager] markedTextAbandoned:self]; 5164 5162 } 5165 5163 } -
TabularUnified trunk/WebKit/WebView.subproj/WebView.m ¶
r10578 r10612 3201 3201 } 3202 3202 } else { 3203 // Inca rnation to perform a selector returning a BOOL from objc/objc-runtime.h3204 isSuitable = ( *(BOOL(*)(id, SEL, ...))objc_msgSend)(sizingDocView, testSel);3203 // Incantation to perform a selector returning a BOOL. 3204 isSuitable = ((BOOL(*)(id, SEL))objc_msgSend)(sizingDocView, testSel); 3205 3205 } 3206 3206
Note:
See TracChangeset
for help on using the changeset viewer.