Changeset 249514 in webkit
- Timestamp:
- Sep 4, 2019, 7:36:28 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKContentViewEditingActions.mm (modified) (2 diffs)
-
Tools/TestWebKitAPI/ios/UIKitSPI.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r249512 r249514 1 2019-09-04 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 MobileSafari may crash when invoking the C++ lambda in -[WKContentView _shareForWebView:] 4 https://bugs.webkit.org/show_bug.cgi?id=201479 5 <rdar://problem/51511834> 6 7 Reviewed by Tim Horton. 8 9 Fix the crash by making -_shareForWebView: robust in the case where there are no selection rects 10 known in the UI process when -[WKContentView _share:] is invoked. 11 12 * UIProcess/ios/WKContentViewInteraction.mm: 13 (-[WKContentView _shareForWebView:]): 14 1 15 2019-09-04 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r249431 r249514 2801 2801 if (error != WebKit::CallbackBase::Error::None) 2802 2802 return; 2803 if (!string) 2803 2804 if (!view->_textSelectionAssistant || !string || view->_page->editorState().isMissingPostLayoutData) 2804 2805 return; 2805 2806 2806 CGRect presentationRect = view->_page->editorState().postLayoutData().selectionRects[0].rect(); 2807 2808 if (view->_textSelectionAssistant) 2809 [view->_textSelectionAssistant showShareSheetFor:string fromRect:presentationRect]; 2807 auto& selectionRects = view->_page->editorState().postLayoutData().selectionRects; 2808 if (selectionRects.isEmpty()) 2809 return; 2810 2811 [view->_textSelectionAssistant showShareSheetFor:string fromRect:selectionRects.first().rect()]; 2810 2812 }); 2811 2813 } -
trunk/Tools/ChangeLog
r249508 r249514 1 2019-09-04 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 MobileSafari may crash when invoking the C++ lambda in -[WKContentView _shareForWebView:] 4 https://bugs.webkit.org/show_bug.cgi?id=201479 5 <rdar://problem/51511834> 6 7 Reviewed by Tim Horton. 8 9 Add a test to verify that the UI process doesn't crash when invoking `_share:` while there's no selection. 10 11 * TestWebKitAPI/Tests/WebKitCocoa/WKContentViewEditingActions.mm: 12 * TestWebKitAPI/ios/UIKitSPI.h: 13 1 14 2019-09-04 Wenson Hsieh <wenson_hsieh@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKContentViewEditingActions.mm
r243354 r249514 32 32 #import "TestNavigationDelegate.h" 33 33 #import "TestWKWebView.h" 34 #import "UIKitSPI.h" 34 35 #import <WebKit/WebKit.h> 35 36 #import <wtf/RetainPtr.h> … … 63 64 } 64 65 66 TEST(WebKit, InvokeShareWithoutSelection) 67 { 68 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 568)]); 69 [webView synchronouslyLoadTestPageNamed:@"simple"]; 70 [[webView textInputContentView] _share:nil]; 71 [webView waitForNextPresentationUpdate]; 72 } 73 65 74 #endif -
trunk/Tools/TestWebKitAPI/ios/UIKitSPI.h
r249508 r249514 256 256 @end 257 257 258 @interface UIResponder (Internal) 259 - (void)_share:(id)sender; 260 @end 261 258 262 #endif // PLATFORM(IOS_FAMILY)
Note:
See TracChangeset
for help on using the changeset viewer.