Bug 143976 - PDFs still don't snapshot properly in iOS Safari
Summary: PDFs still don't snapshot properly in iOS Safari
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-20 18:53 PDT by Tim Horton
Modified: 2015-04-26 02:13 PDT (History)
4 users (show)

See Also:


Attachments
Patch (4.72 KB, patch)
2015-04-20 18:53 PDT, Tim Horton
andersca: 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 2015-04-20 18:53:33 PDT
PDFs still don't snapshot properly in iOS Safari
Comment 1 Tim Horton 2015-04-20 18:53:48 PDT
Created attachment 251210 [details]
Patch
Comment 2 Tim Horton 2015-04-20 18:54:13 PDT
<rdar://problem/18283459>
Comment 3 Anders Carlsson 2015-04-20 21:16:53 PDT
Comment on attachment 251210 [details]
Patch

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

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2648
> +            CGContextRef ctx = UIGraphicsGetCurrentContext();

Please use context instead of context.

> Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2650
> +            CGContextTranslateCTM(ctx, destinationRect.origin.x, destinationRect.origin.y);
> +            CGContextScaleCTM(ctx, imageScale, imageScale);

Do you need to save and restore the state here?
Comment 4 Tim Horton 2015-04-21 00:58:14 PDT
(In reply to comment #3)
> Comment on attachment 251210 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=251210&action=review
> 
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2648
> > +            CGContextRef ctx = UIGraphicsGetCurrentContext();
> 
> Please use context instead of context.

You can't abbreviate it even if you want to :D

> > Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm:2650
> > +            CGContextTranslateCTM(ctx, destinationRect.origin.x, destinationRect.origin.y);
> > +            CGContextScaleCTM(ctx, imageScale, imageScale);
> 
> Do you need to save and restore the state here?

I don't think so, because it's a new context that was just created and will be lost very soon. Seems like that would be a waste of time, right?
Comment 5 Tim Horton 2015-04-21 11:02:49 PDT
http://trac.webkit.org/changeset/183068