[webkit-reviews] review granted: [Bug 201237] Null check webFrame when creating a print preview to prevent a crash. : [Attachment 377487] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 28 14:28:25 PDT 2019


Tim Horton <thorton at apple.com> has granted Megan Gardner
<megan_gardner at apple.com>'s request for review:
Bug 201237: Null check webFrame when creating a print preview to prevent a
crash.
https://bugs.webkit.org/show_bug.cgi?id=201237

Attachment 377487: Patch

https://bugs.webkit.org/attachment.cgi?id=377487&action=review




--- Comment #3 from Tim Horton <thorton at apple.com> ---
Comment on attachment 377487
  --> https://bugs.webkit.org/attachment.cgi?id=377487
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.


More information about the webkit-reviews mailing list