forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Round expected page size in LocalFrameView::ForceLayoutForPagination
This fixes a regression after https://crrev.com/c/1861035 that caused a web page to require more printed pages due to an inconsistency of rounding directions. We used to implicitly round the rect returned by LayoutView::DocumentRect(), as it used to return a snapped-to-int rect. Now that we've started returning a PhysicalRect, it gets to ResizePageRectsKeepingRatio() as is and gets truncated there. So let's round sizes explicitly before passing to ResizePageRectsKeepingRatio(). BUG=650768, b/142742179 Change-Id: I55a9df6977f464452fc4878517796717761c5b07 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1867126 Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Commit-Queue: Andrey Kosyakov <caseq@chromium.org> Cr-Commit-Position: refs/heads/master@{#709153}
- Loading branch information
Showing
3 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<style> | ||
@page { | ||
margin: 0; | ||
size: 53.984375px 53.984375px; | ||
} | ||
* { | ||
margin: 0; | ||
} | ||
div { | ||
background: red; | ||
width: 53.984375px; | ||
height: 53.984375px; | ||
} | ||
</style> | ||
<div></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters