Bug 131325

Summary: [iOS WebKit2] WKPDFView fades in tiles, PDFs load very flashily
Product: WebKit Reporter: Tim Horton <thorton>
Component: WebKit2Assignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, sam, simon.fraser
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch andersca: review+

Description Tim Horton 2014-04-07 16:11:12 PDT
We should add and remove views as we scroll, and use a backing layer to avoid flashiness.

<rdar://problem/16382960>
Comment 1 Tim Horton 2014-04-07 16:32:09 PDT
Created attachment 228769 [details]
patch
Comment 2 Anders Carlsson 2014-04-07 16:39:01 PDT
Comment on attachment 228769 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=228769&action=review

> Source/WebKit2/UIProcess/Cocoa/WKWebViewContentProvider.h:38
>  // FIXME: This should be API.

I think you should extend this FIXME to say that we should come up with a solution for the UIScrollViewDelegate “problem”.

> Source/WebKit2/UIProcess/ios/WKPDFView.mm:134
> +        if (CGRectIntersectsRect(pageInfo.frame, targetRect)) {

Please change this to

if (!CGRectIntersectsRect(pageInfo.frame, targetRect)) {
    [pageInfo.view removeFromSuperview];
    pageInfo.view = nullptr;
    continue;
}
Comment 3 Anders Carlsson 2014-04-07 16:39:33 PDT
Comment on attachment 228769 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=228769&action=review

> Source/WebKit2/UIProcess/ios/WKPDFView.mm:171
> +        pageInfo.view = nullptr;

No need to initialize view here since it's a RetainPtr.
Comment 4 Tim Horton 2014-04-07 17:08:24 PDT
http://trac.webkit.org/changeset/166896