Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"Print" duplicate PDF URL rectangles at the correct offset.
Because of crbug.com/1392701 we currently output URL rectangles (for clickable links in PDFs) for *all* links in the container, *for each fragment* generated by the container, unconditionally. The way it currently works is to traverse the LayoutObject tree and calculate rectangles using LayoutObject::OutlineRects(), which returns rectangles of the link relatively to the first fragment generated by the container. So, when converting this to absolute offsets, it would only be correct in the first fragment. To fix this, translate the paint offset to that of the first fragment when handling subsequent fragments. In order to add a meaningful test, I had to add support for printing other pages than just the first one in print_context_test.cc, and also make sure that the page rectangle used is the one calculated internally (which is typically 33% larger than specified in each direction), so that stuff at the bottom of a page doesn't get clipped away. (cherry picked from commit 3e492d7) Bug: 1392642 Change-Id: Iaa88aa5b1e438241c48db588b0410503adebb3f3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4047783 Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Auto-Submit: Morten Stenshorne <mstensho@chromium.org> Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Original-Commit-Position: refs/heads/main@{#1074671} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4061294 Reviewed-by: Krishna Govind <govind@chromium.org> Commit-Queue: Srinivas Sista <srinivassista@chromium.org> Owners-Override: Srinivas Sista <srinivassista@chromium.org> Cr-Commit-Position: refs/branch-heads/5359@{#1015} Cr-Branched-From: 27d3765-refs/heads/main@{#1058933}
- Loading branch information