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

Unified Diff: Source/WebCore/rendering/RenderView.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 | « Source/WebCore/rendering/RenderView.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderView.cpp
===================================================================
--- Source/WebCore/rendering/RenderView.cpp (revision 118242)
+++ Source/WebCore/rendering/RenderView.cpp (working copy)
@@ -84,13 +84,13 @@
void RenderView::computeLogicalHeight()
{
- if (!printing() && m_frameView)
+ if (!shouldUsePrintingLayout() && m_frameView)
setLogicalHeight(viewLogicalHeight());
}
void RenderView::computeLogicalWidth()
{
- if (!printing() && m_frameView)
+ if (!shouldUsePrintingLayout() && m_frameView)
setLogicalWidth(viewLogicalWidth());
}
@@ -111,11 +111,11 @@
if (!document()->paginated())
setPageLogicalHeight(0);
- if (printing())
+ if (shouldUsePrintingLayout())
m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth();
// Use calcWidth/Height to get the new width/height, since this will take the full page zoom factor into account.
- bool relayoutChildren = !printing() && (!m_frameView || width() != viewWidth() || height() != viewHeight());
+ bool relayoutChildren = !shouldUsePrintingLayout() && (!m_frameView || width() != viewWidth() || height() != viewHeight());
if (relayoutChildren) {
setChildNeedsLayout(true, MarkOnlyThis);
for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
@@ -647,6 +647,15 @@
return document()->printing();
}
+bool RenderView::shouldUsePrintingLayout() const
+{
+ if (!printing() || !m_frameView)
+ return false;
+ Frame* frame = m_frameView->frame();
+ // Only root frame should have special handling for printing.
+ return frame && !frame->tree()->parent();
+}
+
size_t RenderView::getRetainedWidgets(Vector<RenderWidget*>& renderWidgets)
{
size_t size = m_widgets.size();
@@ -711,7 +720,7 @@
LayoutRect RenderView::viewRect() const
{
- if (printing())
+ if (shouldUsePrintingLayout())
return LayoutRect(LayoutPoint(), size());
if (m_frameView)
return m_frameView->visibleContentRect();
@@ -751,7 +760,7 @@
int RenderView::viewHeight() const
{
int height = 0;
- if (!printing() && m_frameView) {
+ if (!shouldUsePrintingLayout() && m_frameView) {
height = m_frameView->layoutHeight();
height = m_frameView->useFixedLayout() ? ceilf(style()->effectiveZoom() * float(height)) : height;
}
@@ -761,7 +770,7 @@
int RenderView::viewWidth() const
{
int width = 0;
- if (!printing() && m_frameView) {
+ if (!shouldUsePrintingLayout() && m_frameView) {
width = m_frameView->layoutWidth();
width = m_frameView->useFixedLayout() ? ceilf(style()->effectiveZoom() * float(width)) : width;
}
« no previous file with comments | « Source/WebCore/rendering/RenderView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698