Bug 135622

Summary: REGRESSION (r164337): Pages are sometimes cut off/oriented incorrectly after using WKThumbnailView
Product: WebKit Reporter: Tim Horton <thorton>
Component: WebKit2Assignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, jeffm, mitz, simon.fraser
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch mitz: review+

Description Tim Horton 2014-08-05 14:39:44 PDT
<rdar://problem/17202556>

WKThumbnailView sets a transform on the drawing area so that we can use low-resolution tiles scaled-up to full-size (and then back down again by clients) for the thumbnail view, but no client of WKThumbnailView intentionally uses this mode anymore; they all use snapshots of the content instead.

We were still pushing the "thumbnail scale" to the page even in snapshotting mode, because we would briefly use the WKView-layer-hosting mode while waiting for the asynchronous snapshot to come in, and would happily apply the transform to the drawing area, etc. If the page programmatically scrolled, however, we could apply the wrong sublayer transform when leaving (the identity would be the correct transform to apply), and would have no way to recover.

There's no need for any of this code, as it's perfectly fine to leave the existing tiles at their existing scale (no "thumbnail scale") before quickly switching to a scaled snapshot (this only happens for views which were parented in the first place; so this is limited to 1 view for the only client). This will also slightly reduce the work the WebProcess does while installing a WKThumbnailView from a parented view.
Comment 1 Tim Horton 2014-08-05 15:22:30 PDT
Created attachment 236051 [details]
patch
Comment 2 mitz 2014-08-05 16:25:03 PDT
Comment on attachment 236051 [details]
patch

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

> Source/WebKit2/ChangeLog:48
> +        Always return true from usesSnapshot; we only support snapshotting WKThumbnailViews.

s/true/YES/.

> Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.h:43
> +// This should be removed when all clients go away; it is always true now.

Ditto.

> Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm:161
> +// This should be removed when all clients go away; it is always true now.

Ditto.
Comment 3 Tim Horton 2014-08-05 16:32:54 PDT
http://trac.webkit.org/changeset/172104