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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2116283002: Don't let rounding prematurely influence document size when printing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@620456-2
Patch Set: bug 467579 Created 4 years, 5 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
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index d269191de65902e37e43757d974330cba09bec18..2d30ace4ebc3563eb0dcc10c539911f46b8c335e 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -1994,12 +1994,12 @@ bool Document::isPageBoxVisible(int pageIndex)
return styleForPage(pageIndex)->visibility() != HIDDEN; // display property doesn't apply to @page.
}
-void Document::pageSizeAndMarginsInPixels(int pageIndex, IntSize& pageSize, int& marginTop, int& marginRight, int& marginBottom, int& marginLeft)
+void Document::pageSizeAndMarginsInPixels(int pageIndex, DoubleSize& pageSize, int& marginTop, int& marginRight, int& marginBottom, int& marginLeft)
{
RefPtr<ComputedStyle> style = styleForPage(pageIndex);
- int width = pageSize.width();
- int height = pageSize.height();
+ double width = pageSize.width();
+ double height = pageSize.height();
switch (style->getPageSizeType()) {
case PAGE_SIZE_AUTO:
break;
@@ -2020,7 +2020,7 @@ void Document::pageSizeAndMarginsInPixels(int pageIndex, IntSize& pageSize, int&
default:
ASSERT_NOT_REACHED();
}
- pageSize = IntSize(width, height);
+ pageSize = DoubleSize(width, height);
// The percentage is calculated with respect to the width even for margin top and bottom.
// http://www.w3.org/TR/CSS2/box.html#margin-properties

Powered by Google App Engine
This is Rietveld 408576698