WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 54348
Crash when printing a document with no pages
https://bugs.webkit.org/show_bug.cgi?id=54348
Summary
Crash when printing a document with no pages
Alexey Proskuryakov
Reported
2011-02-12 22:13:46 PST
WKPage always reports at least one page to print, but then it fails to actually print it.
Attachments
proposed fix
(1.79 KB, patch)
2011-02-12 22:16 PST
,
Alexey Proskuryakov
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2011-02-12 22:16:46 PST
Created
attachment 82249
[details]
proposed fix
mitz
Comment 2
2011-02-12 22:33:05 PST
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?
Alexey Proskuryakov
Comment 3
2011-02-12 22:44:49 PST
> 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.
WebKit Commit Bot
Comment 4
2011-02-13 11:03:19 PST
Comment on
attachment 82249
[details]
proposed fix Clearing flags on attachment: 82249 Committed
r78432
: <
http://trac.webkit.org/changeset/78432
>
WebKit Commit Bot
Comment 5
2011-02-13 11:03:23 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug