RESOLVED FIXED 201237
Null check webFrame when creating a print preview to prevent a crash.
https://bugs.webkit.org/show_bug.cgi?id=201237
Summary Null check webFrame when creating a print preview to prevent a crash.
Megan Gardner
Reported 2019-08-28 14:10:21 PDT
Null check webFrame when creating a print preview to prevent a crash.
Attachments
Patch (4.11 KB, patch)
2019-08-28 14:21 PDT, Megan Gardner
no flags
Patch (4.18 KB, patch)
2019-08-28 14:22 PDT, Megan Gardner
no flags
Patch for landing (4.02 KB, patch)
2019-08-28 15:24 PDT, Megan Gardner
no flags
Megan Gardner
Comment 1 2019-08-28 14:21:28 PDT
Megan Gardner
Comment 2 2019-08-28 14:22:37 PDT
Tim Horton
Comment 3 2019-08-28 14:28:25 PDT
Comment on attachment 377487 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=377487&action=review > Source/WebKit/UIProcess/mac/WKPrintingView.mm:508 > + // Preview isn't available yet, request it asynchronously. This comment should stay where it was! This isn't about the early return, it's about the else case in the inner if. > Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:436 > + auto delegate = adoptNS([[PrintDelegate alloc] init]); > + [webView setUIDelegate:delegate.get()]; > + [webView loadHTMLString:@"<head><title>test_title</title></head><body onload='print()'>hello world!</body>" baseURL:[NSURL URLWithString:@"http://example.com/"]]; > + TestWebKitAPI::Util::run(&done); You can replace these four lines with one: [webView synchronouslyLoadHTMLString:@"<head><title>test_title</title></head><body onload='print()'>hello world!</body>"]; > Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:439 > + // Circumvents Assertion in WebKit. Nevermind, I lied, kill this comment with fire.
Tim Horton
Comment 4 2019-08-28 14:28:49 PDT
Wait no!
Tim Horton
Comment 5 2019-08-28 14:29:10 PDT
Comment on attachment 377487 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=377487&action=review >> Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:436 >> + TestWebKitAPI::Util::run(&done); > > You can replace these four lines with one: > > [webView synchronouslyLoadHTMLString:@"<head><title>test_title</title></head><body onload='print()'>hello world!</body>"]; NEVERMIND I forgot that it is on print() not on load. Leave it be
Wenson Hsieh
Comment 6 2019-08-28 15:20:11 PDT
Megan Gardner
Comment 7 2019-08-28 15:24:04 PDT
Created attachment 377494 [details] Patch for landing
WebKit Commit Bot
Comment 8 2019-08-28 16:07:47 PDT
Comment on attachment 377494 [details] Patch for landing Clearing flags on attachment: 377494 Committed r249224: <https://trac.webkit.org/changeset/249224>
WebKit Commit Bot
Comment 9 2019-08-28 16:07:48 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.