Changeset 210075 in webkit
- Timestamp:
- Dec 21, 2016, 1:30:30 PM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r210074 r210075 1 2016-12-21 Beth Dakin <bdakin@apple.com> 2 3 Holding down on candidates in the TouchBar should show panel on screen 4 https://bugs.webkit.org/show_bug.cgi?id=166367 5 -and corresponding- 6 <rdar://problem/28479236> 7 8 Reviewed by Tim Horton. 9 10 Expose the version of setCandidates: that takes a rect. 11 * platform/spi/cocoa/NSTouchBarSPI.h: 12 1 13 2016-12-21 Michael Catanzaro <mcatanzaro@igalia.com> 2 14 -
trunk/Source/WebCore/platform/spi/cocoa/NSTouchBarSPI.h
r209395 r210075 28 28 #if USE(APPLE_INTERNAL_SDK) 29 29 30 #import <AppKit/NSCandidateListTouchBarItem_Private.h> 30 31 #import <AppKit/NSFunctionBar_Private.h> 31 32 #import <AppKit/NSTextTouchBarItemController_WebKitSPI.h> … … 55 56 @end 56 57 58 @interface NSCandidateListTouchBarItem () 59 - (void)setCandidates:(NSArray *)candidates forSelectedRange:(NSRange)selectedRange inString:(nullable NSString *)string rect:(NSRect)rect view:(nullable NSView *)view completionHandler:(nullable void (^)(id acceptedCandidate))completionBlock; 60 @end 61 57 62 #endif // !USE(APPLE_INTERNAL_SDK) 58 63 -
trunk/Source/WebKit/mac/ChangeLog
r210029 r210075 1 2016-12-21 Beth Dakin <bdakin@apple.com> 2 3 Holding down on candidates in the TouchBar should show panel on screen 4 https://bugs.webkit.org/show_bug.cgi?id=166367 5 -and corresponding- 6 <rdar://problem/28479236> 7 8 Reviewed by Tim Horton. 9 10 Stray whitespace. 11 * WebCoreSupport/WebEditorClient.mm: 12 (WebEditorClient::handleRequestedCandidates): 13 14 Call the version of setCandidates: that takes a rect. We need to keep the helper 15 function in WK1 (unlike WK2) since we also use it for testing. 16 * WebView/WebView.mm: 17 (-[WebView showCandidates:forString:inRect:forSelectedRange:view:completionHandler:]): 18 1 19 2016-12-20 Dean Jackson <dino@apple.com> 2 20 -
trunk/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm
r208452 r210075 1249 1249 1250 1250 [m_webView showCandidates:candidates forString:m_paragraphContextForCandidateRequest.get() inRect:rectForSelectionCandidates forSelectedRange:m_rangeForCandidates view:m_webView completionHandler:nil]; 1251 1252 1251 } 1253 1252 -
trunk/Source/WebKit/mac/WebView/WebView.mm
r210016 r210075 5026 5026 - (void)showCandidates:(NSArray<NSTextCheckingResult *> *)candidates forString:(NSString *)string inRect:(NSRect)rectOfTypedString forSelectedRange:(NSRange)range view:(NSView *)view completionHandler:(void (^)(NSTextCheckingResult *acceptedCandidate))completionBlock 5027 5027 { 5028 [self.candidateList setCandidates:candidates forSelectedRange:range inString:string ];5028 [self.candidateList setCandidates:candidates forSelectedRange:range inString:string rect:rectOfTypedString view:view completionHandler:completionBlock]; 5029 5029 } 5030 5030 -
trunk/Source/WebKit2/ChangeLog
r210053 r210075 1 2016-12-21 Beth Dakin <bdakin@apple.com> 2 3 Holding down on candidates in the TouchBar should show panel on screen 4 https://bugs.webkit.org/show_bug.cgi?id=166367 5 -and corresponding- 6 <rdar://problem/28479236> 7 8 Reviewed by Tim Horton. 9 10 The showCandidates() helper function is not needed. We can call the AppKit method 11 directly at the one call site. 12 * UIProcess/Cocoa/WebViewImpl.h: 13 * UIProcess/Cocoa/WebViewImpl.mm: 14 15 The panel should appear under the selection, so offset the selection rect. 16 (WebKit::WebViewImpl::handleRequestedCandidates): 17 18 No more showCandidates() since we can call it directly. 19 (WebKit::WebViewImpl::showCandidates): Deleted. 20 1 21 2016-12-20 Taras Tsugrii <ttsugrii@fb.com> 2 22 -
trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h
r209782 r210075 494 494 void forceRequestCandidatesForTesting(); 495 495 bool shouldRequestCandidates() const; 496 void showCandidates(NSArray *candidates, NSString *, NSRect rectOfTypedString, NSRange selectedRange, NSView *, void (^completionHandler)(NSTextCheckingResult *acceptedCandidate));497 496 498 497 bool windowIsFrontWindowUnderMouse(NSEvent *); -
trunk/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm
r209782 r210075 1184 1184 } 1185 1185 1186 void WebViewImpl::showCandidates(NSArray *candidates, NSString *string, NSRect rectOfTypedString, NSRange selectedRange, NSView *view, void (^completionHandler)(NSTextCheckingResult *acceptedCandidate))1187 {1188 [candidateListTouchBarItem() setCandidates:candidates forSelectedRange:selectedRange inString:string];1189 }1190 1191 1186 void WebViewImpl::setEditableElementIsFocused(bool editableElementIsFocused) 1192 1187 { … … 1211 1206 { 1212 1207 return false; 1213 }1214 1215 void WebViewImpl::showCandidates(NSArray *candidates, NSString *string, NSRect rectOfTypedString, NSRange selectedRange, NSView *view, void (^completionHandler)(NSTextCheckingResult *acceptedCandidate))1216 {1217 1208 } 1218 1209 … … 2995 2986 NSRange selectedRange = NSMakeRange(postLayoutData.candidateRequestStartPosition, postLayoutData.selectedTextLength); 2996 2987 auto weakThis = createWeakPtr(); 2997 showCandidates(candidates, postLayoutData.paragraphContextForCandidateRequest, postLayoutData.selectionClipRect, selectedRange, m_view, [weakThis](NSTextCheckingResult *acceptedCandidate) { 2998 dispatch_async(dispatch_get_main_queue(), ^{ 2999 if (!weakThis) 3000 return; 3001 weakThis->handleAcceptedCandidate(acceptedCandidate); 3002 }); 3003 }); 2988 WebCore::IntRect offsetSelectionRect = postLayoutData.selectionClipRect; 2989 offsetSelectionRect.move(0, offsetSelectionRect.height()); 2990 2991 [candidateListTouchBarItem() setCandidates:candidates forSelectedRange:selectedRange inString:postLayoutData.paragraphContextForCandidateRequest rect:offsetSelectionRect view:m_view completionHandler:nil]; 3004 2992 } 3005 2993
Note:
See TracChangeset
for help on using the changeset viewer.