We don't really need to use private methods. Patch forthcoming.
Created attachment 80706 [details] proposed patch
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.
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?
> 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>.