Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: Source/WebCore/page/Frame.cpp

Issue 10427008: Merge 118039 - Source/WebCore: Fix iframe printing. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/WebCore/rendering/RenderView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/page/Frame.cpp
===================================================================
--- Source/WebCore/page/Frame.cpp (revision 118242)
+++ Source/WebCore/page/Frame.cpp (working copy)
@@ -522,9 +522,10 @@
view()->adjustMediaTypeForPrinting(printing);
m_doc->styleResolverChanged(RecalcStyleImmediately);
- if (printing)
+ if (printing && !tree()->parent()) {
+ // Only root frame should be fit to page size. Subframes should be constrained by parents only.
view()->forceLayoutForPagination(pageSize, originalPageSize, maximumShrinkRatio, shouldAdjustViewSize);
- else {
+ } else {
view()->forceLayout();
if (shouldAdjustViewSize == AdjustViewSize)
view()->adjustViewSize();
@@ -542,10 +543,12 @@
return FloatSize();
if (contentRenderer()->style()->isHorizontalWritingMode()) {
+ ASSERT(fabs(originalSize.width()) > numeric_limits<float>::epsilon());
float ratio = originalSize.height() / originalSize.width();
resultSize.setWidth(floorf(expectedSize.width()));
resultSize.setHeight(floorf(resultSize.width() * ratio));
} else {
+ ASSERT(fabs(originalSize.height()) > numeric_limits<float>::epsilon());
float ratio = originalSize.width() / originalSize.height();
resultSize.setHeight(floorf(expectedSize.height()));
resultSize.setWidth(floorf(resultSize.height() * ratio));
« no previous file with comments | « no previous file | Source/WebCore/rendering/RenderView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698