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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutView.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 if (hasOverflowClip()) 826 if (hasOverflowClip())
827 excludeScrollbars(rect, overlayScrollbarClipBehavior); 827 excludeScrollbars(rect, overlayScrollbarClipBehavior);
828 828
829 return rect; 829 return rect;
830 } 830 }
831 831
832 IntRect LayoutView::documentRect() const 832 IntRect LayoutView::documentRect() const
833 { 833 {
834 LayoutRect overflowRect(layoutOverflowRect()); 834 LayoutRect overflowRect(layoutOverflowRect());
835 flipForWritingMode(overflowRect); 835 flipForWritingMode(overflowRect);
836 return pixelSnappedIntRect(overflowRect); 836 return IntRect(roundedIntPoint(overflowRect.location()), IntSize(
837 floorToInt(overflowRect.width()),
eae 2016/07/12 22:26:39 This is incorrect. We do not floor sizes, we pixel
rhogan 2016/07/13 18:27:13 Yes, this is wrong.
838 floorToInt(overflowRect.height())));
837 } 839 }
838 840
839 bool LayoutView::rootBackgroundIsEntirelyFixed() const 841 bool LayoutView::rootBackgroundIsEntirelyFixed() const
840 { 842 {
841 return style()->hasEntirelyFixedBackground(); 843 return style()->hasEntirelyFixedBackground();
842 } 844 }
843 845
844 LayoutRect LayoutView::backgroundRect(LayoutBox* backgroundLayoutObject) const 846 LayoutRect LayoutView::backgroundRect(LayoutBox* backgroundLayoutObject) const
845 { 847 {
846 return LayoutRect(documentRect()); 848 return LayoutRect(documentRect());
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1003 // of this override. All frame scrolling should be handled by 1005 // of this override. All frame scrolling should be handled by
1004 // ViewportScrollCallback. 1006 // ViewportScrollCallback.
1005 1007
1006 if (!frameView()) 1008 if (!frameView())
1007 return ScrollResult(false, false, delta.width(), delta.height()); 1009 return ScrollResult(false, false, delta.width(), delta.height());
1008 1010
1009 return frameView()->getScrollableArea()->userScroll(granularity, delta); 1011 return frameView()->getScrollableArea()->userScroll(granularity, delta);
1010 } 1012 }
1011 1013
1012 } // namespace blink 1014 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698