RESOLVED FIXED 53466
Move WebKit2 to printing via API methods
https://bugs.webkit.org/show_bug.cgi?id=53466
Summary Move WebKit2 to printing via API methods
Alexey Proskuryakov
Reported 2011-01-31 18:22:08 PST
We don't really need to use private methods. Patch forthcoming.
Attachments
proposed patch (12.24 KB, patch)
2011-01-31 18:41 PST, Alexey Proskuryakov
mjs: review+
Alexey Proskuryakov
Comment 1 2011-01-31 18:41:05 PST
Created attachment 80706 [details] proposed patch
Alexey Proskuryakov
Comment 2 2011-01-31 18:41:55 PST
Sorry that this includes some unrelated fixes which I had to make to meaningfully debug this. These are small and hopefully won't make reviewing much harder.
Maciej Stachowiak
Comment 3 2011-01-31 19:06:56 PST
Comment on attachment 80706 [details] proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=80706&action=review r=me but see comments > Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm:114 > + return [[[[_printOperation printInfo] dictionary] objectForKey:NSPrintFirstPage] unsignedIntegerValue]; Perhaps it's worth it to encapsulate this dictionary lookup and its comment in a method, so that the similar calls below could reuse it. > Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm:123 > + // Need to directly access the dictionary because -[NSPrintOperation pageRange] verifies pagination, potentially causing recursion. > + NSUInteger firstPage = [[[[_printOperation printInfo] dictionary] objectForKey:NSPrintFirstPage] unsignedIntegerValue]; > + NSUInteger lastPage = [[[[_printOperation printInfo] dictionary] objectForKey:NSPrintLastPage] unsignedIntegerValue]; Aforementioned similar calls. > Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm:166 > + if (data) { Is it possible to change this if block to an early return with the reverse condition?
Alexey Proskuryakov
Comment 4 2011-01-31 21:55:26 PST
> Is it possible to change this if block to an early return with the reverse condition? It's not, but only because the block encompassed too much code. Fixed now. Committed <http://trac.webkit.org/changeset/77220>.
Note You need to log in before you can comment on or make changes to this bug.