Closed Bug 1858218 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 42460 - Revert "Recalculate style before setting ICB size for printing."

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox121 fixed)

RESOLVED FIXED
121 Branch
Tracking Status
firefox121 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Phillis Tang <phillis@chromium.org> wrote:

Revert "Recalculate style before setting ICB size for printing."

This reverts commit f992984634e8ffc2a9faba835da87085d7a79916.

Reason for revert: Causing PrintBrowserTest.NoResizeEvent to fail on Linux. Example build: https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20ChromiumOS%20MSan%20Tests/38907/overview

Original change's description:

Recalculate style before setting ICB size for printing.

A zoom factor used when viewing a webpage on screen may have been set in
computed style. This would affect @page margin resolution incorrectly
when entering print mode, which in turn would result in an incorrect
initial containing block size. To fix this, recalculate style before
calculating the page area size.

Since we now recalculate style before setting any initial containing
block size for printing at all, viewport units will not be resolved
correctly. So make sure that they get calculated before laying out. This
used to be triggered by calling LayoutViewportWasResized(). It turns out
though, now that we need to do this unconditionally before the first
layout, that LayoutViewportWasResized() does more than we want. For
printing, we don't need to re-evaluate media queries, and we do not want
a resize event to be fired. Therefore, split the viewport units dirtying
into a separate function. Introduce a lambda in
ForceLayoutForPagination() to avoid repetitive code.

Make PrintBrowserTest.NoResizeEvent more evil, by modifying its resource
HTML file to use a named page, and also a wide DIV. This would make the
test fail without this CL.

Add external/wpt/css/printing/ to the scalefactor200 virtual test suite.
Three other tests (the already existing page-margin-xxx tests) would
also fail without this fix, but add a test for this specific issue
(abspos) as well.

Bug: 1488751, 1486499
Change-Id: If42211ddb6aadc49dcdee71ccd9597aa2818a672
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4922711
Reviewed-by: Rune Lillesveen \<futhark@chromium.org>
Commit-Queue: Morten Stenshorne \<mstensho@chromium.org>
Reviewed-by: Ian Kilpatrick \<ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1207513}

Bug: 1488751, 1486499
Change-Id: I84bcbf4acea734cea3a495ea9ac78399c8801345
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4927588
Owners-Override: Phillis Tang \<phillis@chromium.org>
Bot-Commit: Rubber Stamper \<rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Phillis Tang \<phillis@chromium.org>
Commit-Queue: Rubber Stamper \<rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1207774}

PR 42460 applied with additional changes from upstream: bcd57c07cd014003f58d693e63a5d0dfe39fb57c
The PR was not expected to affect any tests, but the try push wasn't a success. Check the try results for infrastructure issues
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e7ccc6b6699b [wpt PR 42460] - Revert "Recalculate style before setting ICB size for printing.", a=testonly
Test result changes from PR not available.
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch
You need to log in before you can comment on or make changes to this bug.