Bug 135622 - REGRESSION (r164337): Pages are sometimes cut off/oriented incorrectly after using WKThumbnailView
Summary: REGRESSION (r164337): Pages are sometimes cut off/oriented incorrectly after ...
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
Keywords: InRadar
Depends on:
Reported: 2014-08-05 14:39 PDT by Tim Horton
Modified: 2014-08-05 16:32 PDT (History)
4 users (show)

See Also:

patch (17.89 KB, patch)
2014-08-05 15:22 PDT, Tim Horton
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2014-08-05 14:39:44 PDT

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]
Comment 2 mitz 2014-08-05 16:25:03 PDT
Comment on attachment 236051 [details]

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.


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


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

Comment 3 Tim Horton 2014-08-05 16:32:54 PDT