Closed Bug 1895703 Opened 9 months ago Closed 9 months ago

[wpt-sync] Sync PR 46163 - Resolve page size using standard length utils.

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 46163 into mozilla-central (this bug is closed when the sync is complete).

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

Morten Stenshorne <mstensho@chromium.org> wrote:

Resolve page size using standard length utils.

Calculating the page area size is very similar to how the content box
size of a regular non-replaced CSS box is calculated.

content box + padding + border + margin = size of containing block

The only differences:

  1. percentage-based padding/margins in a given dimension are resolved
    against the containing block size in that dimension (i.e. a
    percentage-based margin-top is resolved against the containing block
    height), not unconditionally against the inline-size of the containing
    block (regular CSS boxes)

  2. Overconstrainedness is resolved differently. Rather than adjusting
    margins to fix the equation, the containing block size is adjusted.

Auto @page margins are also handled correctly now. Tests included.

Clean up pagination stuff in Document, and move the logic of
GetPageDescription() into pagination utils in layout, and only call it
from external APIs (we used to need it during layout as well, but not
anymore). The end goal here is to be able to implement this by examining
the physical fragments, but we're not quite there yet, since Blink still
doesn't control the margin area of the page.

Improve detection of unusable page sizes (if margins+border+padding are
larger than the containing block). We'll now recalculate computed style
for such page containers, and just ignore all author styles.

Bug: 40286153
Change-Id: Id660b7e60d71256f32cb56db1cf419ad8ac91c2c

Reviewed-on: https://chromium-review.googlesource.com/5522379
WPT-Export-Revision: 5367bfd18f6f711269c48a837cb42f269d75914e

Component: web-platform-tests → Layout
Product: Testing → Core

CI Results

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

Total 4 tests

Status Summary

Firefox

FAIL: 4

Chrome

FAIL: 4

Links

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/98e99918ce04 [wpt PR 46163] - Resolve page size using standard length utils., a=testonly https://hg.mozilla.org/integration/autoland/rev/e55bcdacb1f3 [wpt PR 46163] - 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.