Summary: | [WebKit2][iOS] PDF | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Tim Horton <thorton> | ||||||||||||
Component: | WebKit2 | Assignee: | Tim Horton <thorton> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Normal | CC: | andersca, mitz, sam | ||||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||
Hardware: | Unspecified | ||||||||||||||
OS: | Unspecified | ||||||||||||||
Bug Depends on: | 129809 | ||||||||||||||
Bug Blocks: | |||||||||||||||
Attachments: |
|
Description
Tim Horton
2014-03-02 23:13:27 PST
Created attachment 225633 [details]
preliminary
Created attachment 225634 [details]
patch
Created attachment 225635 [details]
still preliminary
Comment on attachment 225635 [details] still preliminary View in context: https://bugs.webkit.org/attachment.cgi?id=225635&action=review > Source/WebKit2/Configurations/WebKit2.xcconfig:33 > +FRAMEWORK_AND_LIBRARY_LDFLAGS_iphonesimulator = -lobjc -framework CFNetwork -framework CoreFoundation -framework CoreGraphics -framework CoreText -framework Foundation -framework GraphicsServices -framework ImageIO -framework UIKit -framework WebKit -lMobileGestalt -lassertion_extension -framework CorePDF; alphabetize > Source/WebKit2/UIProcess/Cocoa/CustomRepresentationManager.h:46 > + another header > Source/WebKit2/UIProcess/Cocoa/CustomRepresentationManager.h:47 > +- (instancetype)initWithFrame:(CGRect)frame; nope > Source/WebKit2/UIProcess/Cocoa/CustomRepresentationManager.h:49 > +- (void)setData:(CFDataRef)data; web_setCustomRepresentationData or setWebCustomRepresentationData or something like that (and Dan says it should be NSData instead) > Source/WebKit2/UIProcess/Cocoa/CustomRepresentationManager.h:52 > +- (void)setContentInset:(UIEdgeInsets)insets; don't need this if we re-use the scrollview > Source/WebKit2/UIProcess/Cocoa/CustomRepresentationManager.h:62 > +struct CustomRepresentation { > + Class representationClass; > + String mimeType; > +}; move into the class Created attachment 225964 [details]
patch
I just noticed that we need to save and restore a few more scrollview properties (minimum and maximum magnification at least) in the case where you are navigating back to a page that's in the page cache (but we can just do it always, I think); I'll fix that up tomorrow.
Splitting this up. Created attachment 226106 [details] split patch This now depends on https://bugs.webkit.org/show_bug.cgi?id=129809 so it won't apply yet. Comment on attachment 226106 [details] split patch View in context: https://bugs.webkit.org/attachment.cgi?id=226106&action=review > Source/WebKit2/UIProcess/ios/WKPDFView.mm:46 > +@interface WKPDFView () { > + RetainPtr<UIPDFDocument> _pdfDocument; > + Vector<UIPDFPageView*> _pageViews; > + CGSize _minimumSize; > + UIScrollView *_scrollView; > +} > +@end Just move these to the @implementation section instead. > Source/WebKit2/UIProcess/ios/WKPDFView.mm:55 > + [self setBackgroundColor:[UIColor grayColor]]; self.backgroundColor = > Source/WebKit2/UIProcess/ios/WKPDFView.mm:79 > + [[pageView contentLayer] setContentsScale:self.window.screen.scale]; pageView.contentLayer.contentsScale = |