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

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

Issue 10700087: Merge 119548 - Special layout handler should be done on top frame being printed. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 6 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 | « Source/WebCore/page/Frame.h ('k') | Source/WebCore/rendering/RenderView.cpp » ('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 121785)
+++ Source/WebCore/page/Frame.cpp (working copy)
@@ -522,8 +522,7 @@
view()->adjustMediaTypeForPrinting(printing);
m_doc->styleResolverChanged(RecalcStyleImmediately);
- if (printing && !tree()->parent()) {
- // Only root frame should be fit to page size. Subframes should be constrained by parents only.
+ if (shouldUsePrintingLayout()) {
view()->forceLayoutForPagination(pageSize, originalPageSize, maximumShrinkRatio, shouldAdjustViewSize);
} else {
view()->forceLayout();
@@ -536,6 +535,13 @@
child->setPrinting(printing, FloatSize(), FloatSize(), 0, shouldAdjustViewSize);
}
+bool Frame::shouldUsePrintingLayout() const
+{
+ // Only top frame being printed should be fit to page size.
+ // Subframes should be constrained by parents only.
+ return m_doc->printing() && (!tree()->parent() || !tree()->parent()->m_doc->printing());
+}
+
FloatSize Frame::resizePageRectsKeepingRatio(const FloatSize& originalSize, const FloatSize& expectedSize)
{
FloatSize resultSize;
« no previous file with comments | « Source/WebCore/page/Frame.h ('k') | Source/WebCore/rendering/RenderView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698