Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move page margin handling over to Blink.
Remove the margin handling code from PrintRenderFrameHelper (used by the actual browser) and SpoolPagesWithBoundariesForTesting() (web tests). This allows @page backgrounds to cover the entire page box, including the margin area. Tests included. This CL also paves the road for implementing @page margin boxes (such as author-specified headers and footers), which was the main objective anyway. The fact that Blink is now responsible for the entire page box means that the code that deals with shrinking / centering paginated content to fit the target paper also has to be moved over to Blink. WebPrintPageDescription still provides margin info for each page. Although PrintRenderFrameHelper no longer needs to position the page area within the page box based on margins, the margins are still needed in order to figure out if there's enough room for UA-generated headers and footers. By moving all of this into Blink, it will be rather straight-forward to add web tests for page fitting, rather than writing clunky PrintRenderFrameHelper component browser tests for it. Will follow up with a CL for this. Three page-orientation tests now start passing. The code in SpoolPagesWithBoundariesForTesting() didn't add margin translation at the correct time when rotating. The margins are no longer added there, so the problem is gone. Bug: 40286153, 40341678 Change-Id: I418b2e08ed76b297ea5d5fc223545b52b3e9b09f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526464 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Morten Stenshorne <mstensho@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Cr-Commit-Position: refs/heads/main@{#1300225}
- Loading branch information