Changeset 249240 in webkit
- Timestamp:
- Aug 28, 2019, 10:57:14 PM (7 years ago)
- Location:
- branches/safari-608-branch
- Files:
-
- 4 edited
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/mac/WKPrintingView.mm (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-608-branch/Source/WebKit/ChangeLog
r249167 r249240 1 2019-08-28 Kocsen Chung <kocsen_chung@apple.com> 2 3 Cherry-pick r249224. rdar://problem/54819205 4 5 Null check webFrame when creating a print preview to prevent a crash. 6 https://bugs.webkit.org/show_bug.cgi?id=201237 7 <rdar://problem/51618863> 8 9 Reviewed by Tim Horton. 10 11 Source/WebKit: 12 13 Move and expend a null check to keep from crashing when making a print preview. 14 15 * UIProcess/mac/WKPrintingView.mm: 16 (-[WKPrintingView _drawPreview:]): 17 (-[WKPrintingView drawRect:]): 18 19 Tools: 20 21 Test to verify that if we don't have the WebPageProxy, we will not crash when making a print preview. 22 23 * TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm: 24 (TEST): 25 26 27 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249224 268f45cc-cd09-0410-ab3c-d52691b4dbfc 28 29 2019-08-28 Megan Gardner <megan_gardner@apple.com> 30 31 Null check webFrame when creating a print preview to prevent a crash. 32 https://bugs.webkit.org/show_bug.cgi?id=201237 33 <rdar://problem/51618863> 34 35 Reviewed by Tim Horton. 36 37 Move and expend a null check to keep from crashing when making a print preview. 38 39 * UIProcess/mac/WKPrintingView.mm: 40 (-[WKPrintingView _drawPreview:]): 41 (-[WKPrintingView drawRect:]): 42 1 43 2019-08-27 Alan Coon <alancoon@apple.com> 2 44 -
branches/safari-608-branch/Source/WebKit/UIProcess/mac/WKPrintingView.mm
r244202 r249240 505 505 { 506 506 ASSERT(RunLoop::isMain()); 507 508 if (!_webFrame || !_webFrame->page()) 509 return; 507 510 508 511 WebCore::IntRect scaledPrintingRect(nsRect); … … 520 523 } else { 521 524 // Preview isn't available yet, request it asynchronously. 522 if (!_webFrame->page())523 return;524 525 525 // Return to printing mode if we're already back to screen (e.g. due to window resizing). 526 526 _webFrame->page()->beginPrinting(_webFrame.get(), WebKit::PrintInfo([_printOperation printInfo])); -
branches/safari-608-branch/Tools/ChangeLog
r248844 r249240 1 2019-08-28 Kocsen Chung <kocsen_chung@apple.com> 2 3 Cherry-pick r249224. rdar://problem/54819205 4 5 Null check webFrame when creating a print preview to prevent a crash. 6 https://bugs.webkit.org/show_bug.cgi?id=201237 7 <rdar://problem/51618863> 8 9 Reviewed by Tim Horton. 10 11 Source/WebKit: 12 13 Move and expend a null check to keep from crashing when making a print preview. 14 15 * UIProcess/mac/WKPrintingView.mm: 16 (-[WKPrintingView _drawPreview:]): 17 (-[WKPrintingView drawRect:]): 18 19 Tools: 20 21 Test to verify that if we don't have the WebPageProxy, we will not crash when making a print preview. 22 23 * TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm: 24 (TEST): 25 26 27 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249224 268f45cc-cd09-0410-ab3c-d52691b4dbfc 28 29 2019-08-28 Megan Gardner <megan_gardner@apple.com> 30 31 Null check webFrame when creating a print preview to prevent a crash. 32 https://bugs.webkit.org/show_bug.cgi?id=201237 33 <rdar://problem/51618863> 34 35 Reviewed by Tim Horton. 36 37 Test to verify that if we don't have the WebPageProxy, we will not crash when making a print preview. 38 39 * TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm: 40 (TEST): 41 1 42 2019-08-18 Babak Shafiei <bshafiei@apple.com> 2 43 -
branches/safari-608-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm
r243094 r249240 428 428 } 429 429 430 TEST(WebKit, PrintPreview) 431 { 432 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600)]); 433 auto delegate = adoptNS([[PrintDelegate alloc] init]); 434 [webView setUIDelegate:delegate.get()]; 435 [webView loadHTMLString:@"<head><title>test_title</title></head><body onload='print()'>hello world!</body>" baseURL:[NSURL URLWithString:@"http://example.com/"]]; 436 TestWebKitAPI::Util::run(&done); 437 438 NSPrintOperation *operation = [webView _printOperationWithPrintInfo:[NSPrintInfo sharedPrintInfo]]; 439 NSPrintOperation.currentOperation = operation; 440 auto previewView = [operation view]; 441 [webView _close]; 442 [previewView drawRect:CGRectMake(0, 0, 10, 10)]; 443 } 444 430 445 @interface NotificationDelegate : NSObject <WKUIDelegatePrivate> { 431 446 bool _allowNotifications;
Note:
See TracChangeset
for help on using the changeset viewer.