Changeset 249224 in webkit
- Timestamp:
- Aug 28, 2019, 4:07:40 PM (7 years ago)
- Location:
- trunk
- 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
-
trunk/Source/WebKit/ChangeLog
r249217 r249224 1 2019-08-28 Megan Gardner <megan_gardner@apple.com> 2 3 Null check webFrame when creating a print preview to prevent a crash. 4 https://bugs.webkit.org/show_bug.cgi?id=201237 5 <rdar://problem/51618863> 6 7 Reviewed by Tim Horton. 8 9 Move and expend a null check to keep from crashing when making a print preview. 10 11 * UIProcess/mac/WKPrintingView.mm: 12 (-[WKPrintingView _drawPreview:]): 13 (-[WKPrintingView drawRect:]): 14 1 15 2019-08-28 Said Abou-Hallawa <sabouhallawa@apple.com> 2 16 -
trunk/Source/WebKit/UIProcess/mac/WKPrintingView.mm
r244202 r249224 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])); -
trunk/Tools/ChangeLog
r249213 r249224 1 2019-08-28 Megan Gardner <megan_gardner@apple.com> 2 3 Null check webFrame when creating a print preview to prevent a crash. 4 https://bugs.webkit.org/show_bug.cgi?id=201237 5 <rdar://problem/51618863> 6 7 Reviewed by Tim Horton. 8 9 Test to verify that if we don't have the WebPageProxy, we will not crash when making a print preview. 10 11 * TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm: 12 (TEST): 13 1 14 2019-08-28 Jonathan Bedard <jbedard@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm
r243094 r249224 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.