Closed Bug 1896194 Opened 9 months ago Closed 9 months ago

[wpt-sync] Sync PR 46205 - Move page margin handling over to Blink.

Categories

(Core :: Layout, task, P4)

task

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 46205 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/46205
Details from upstream follow.

Morten Stenshorne <mstensho@chromium.org> wrote:

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/5526464
WPT-Export-Revision: c187830b21f188ce2ec49f356718e4d214728085

Component: web-platform-tests → Layout
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 6 Firefox configurations based on mozilla-central, and Firefox, and Chrome on GitHub CI

Total 2 tests

Status Summary

Firefox

FAIL: 2

Chrome

FAIL: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b43e695dd7bf [wpt PR 46205] - Move page margin handling over to Blink., a=testonly https://hg.mozilla.org/integration/autoland/rev/8539c1ac01b6 [wpt PR 46205] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.