Summary: | Crash when printing a document with no pages | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alexey Proskuryakov <ap> | ||||
Component: | Printing | Assignee: | Alexey Proskuryakov <ap> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | commit-queue, mitz | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Mac | ||||||
OS: | OS X 10.6 | ||||||
Attachments: |
|
Description
Alexey Proskuryakov
2011-02-12 22:13:46 PST
Created attachment 82249 [details]
proposed fix
Comment on attachment 82249 [details] proposed fix View in context: https://bugs.webkit.org/attachment.cgi?id=82249&action=review > Source/WebKit2/ChangeLog:8 > + * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::drawPagesToPDF): Don't fail on a fake Can you add a newline between the filename and the function name? > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:2015 > + CGRect mediaBox = m_printContext->pageCount() ? m_printContext->pageRect(0) : CGRectMake(0, 0, 1, 1); What happens if you use CGRectZero instead? > Can you add a newline between the filename and the function name? Not without taking this out of commit queue :) > What happens if you use CGRectZero instead? AppKit prints a blank page without headers and footers, which is probably incorrect. In fact, we end up passing a zero rectangle in -[WKPrintingView rectForPage:] due to IntRect.scale() rounding to zero in the end, and this rounding is not good. However, this is a situation that should not really ever happen, and I only noticed this because of <rdar://problem/8994076>. I don't want to achieve perfect behavior in this impossible situation (or even to file bugs), but I wanted to avoid crashing, and I didn't want to explicitly write incorrect code returning a zero rect. Comment on attachment 82249 [details] proposed fix Clearing flags on attachment: 82249 Committed r78432: <http://trac.webkit.org/changeset/78432> All reviewed patches have been landed. Closing bug. |