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

Unified Diff: third_party/WebKit/Source/core/page/PrintContext.cpp

Issue 2653963002: [Experimental] Supporting OOPIF printing
Patch Set: Rename service, fix for webview, and connect to DiscardableMemoryManager Created 3 years, 9 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 | « third_party/WebKit/Source/core/loader/EmptyClients.h ('k') | third_party/WebKit/Source/core/paint/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/PrintContext.cpp
diff --git a/third_party/WebKit/Source/core/page/PrintContext.cpp b/third_party/WebKit/Source/core/page/PrintContext.cpp
index e88fd38599e162a4fd98c01cee87e5ed16616fcb..11e4500ea66b34d19cae9fb0eea65218b768a2b6 100644
--- a/third_party/WebKit/Source/core/page/PrintContext.cpp
+++ b/third_party/WebKit/Source/core/page/PrintContext.cpp
@@ -67,7 +67,10 @@ void PrintContext::computePageRects(const FloatRect& printRect,
}
LayoutViewItem view = m_frame->document()->layoutViewItem();
- const IntRect& documentRect = view.documentRect();
+ const IntRect& documentRect0 = view.documentRect();
+ IntSize layout1Rect = view.layoutSize(IncludeScrollbars);
+ IntRect documentRect(documentRect0.location(), layout1Rect);
+
FloatSize pageSize = m_frame->resizePageRectsKeepingRatio(
FloatSize(printRect.width(), printRect.height()),
FloatSize(documentRect.width(), documentRect.height()));
@@ -101,7 +104,11 @@ void PrintContext::computePageRectsWithPageSizeInternal(
LayoutViewItem view = m_frame->document()->layoutViewItem();
- IntRect docRect = view.documentRect();
+ IntRect docRect0 = view.documentRect();
+ IntRect viewRect(view.viewRect());
+ IntSize layoutRect = view.layoutSize();
+ IntSize layout1Rect = view.layoutSize(IncludeScrollbars);
+ IntRect docRect(docRect0.location(), layout1Rect);
int pageWidth = pageSizeInPixels.width();
// We scaled with floating point arithmetic and need to ensure results like
« no previous file with comments | « third_party/WebKit/Source/core/loader/EmptyClients.h ('k') | third_party/WebKit/Source/core/paint/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698