- WebCore part of fix for <rdar://problem/
3980651> REGRESSION (125-180): Huge number of pages printed from certain page,
iFrame involved
This also fixes the problems with printing from GMail, yay!
* khtml/rendering/render_flow.cpp:
(RenderFlow::paintLines):
If the current line is taller than the entire page height (e.g. tall iFrame), don't try
to avoid splitting it across pages.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
Handle error cases in a more obvious manner; this will cause future problems like this
to print a blank page and complain to the console on debug builds, rather than print a
zillionty mostly-blank pages.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8509
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2005-02-02 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Chris.
+
+ - WebCore part of fix for <rdar://problem/3980651> REGRESSION (125-180): Huge number of pages printed from certain page,
+ iFrame involved
+
+ This also fixes the problems with printing from GMail, yay!
+
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::paintLines):
+ If the current line is taller than the entire page height (e.g. tall iFrame), don't try
+ to avoid splitting it across pages.
+
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
+ Handle error cases in a more obvious manner; this will cause future problems like this
+ to print a blank page and complain to the console on debug builds, rather than print a
+ zillionty mostly-blank pages.
+
2005-02-02 Chris Blumenberg <cblu@apple.com>
Fixed: <rdar://problem/3960304> can't load a particular applet (at www.escape.de) unless it's the first applet to be loaded
// It is utterly inadequate, and this should not be done at paint time at all.
// The whole way objects break across pages needs to be redone.
RenderCanvas* c = canvas();
- if (_ty + curr->root()->bottomOverflow() > c->printRect().y() + c->printRect().height()) {
- if (_ty + curr->root()->topOverflow() < c->truncatedAt())
- c->setBestTruncatedAt(_ty + curr->root()->topOverflow(), this);
- // Let's stop here.
- break;
+ // Try to avoid splitting a line vertically, but only if it's less than the height
+ // of the entire page.
+ if (curr->root()->bottomOverflow() - curr->root()->topOverflow() <= c->printRect().height()) {
+ if (_ty + curr->root()->bottomOverflow() > c->printRect().y() + c->printRect().height()) {
+ if (_ty + curr->root()->topOverflow() < c->truncatedAt())
+ c->setBestTruncatedAt(_ty + curr->root()->topOverflow(), this);
+ // Let's stop here.
+ break;
+ }
}
}
{
[self _setupRootForPrinting:YES];
NSMutableArray* pages = [NSMutableArray arrayWithCapacity:5];
- if (printWidthScaleFactor == 0 || printHeight == 0)
+ if (printWidthScaleFactor <= 0) {
+ ERROR("printWidthScaleFactor has bad value %.2f", printWidthScaleFactor);
return pages;
+ }
+
+ if (printHeight <= 0) {
+ ERROR("printHeight has bad value %.2f", printHeight);
+ return pages;
+ }
if (!_part || !_part->xmlDocImpl() || !_part->view()) return pages;
RenderCanvas* root = static_cast<khtml::RenderCanvas *>(_part->xmlDocImpl()->renderer());