Bug 1865833 [wpt PR 43284] - Don't attempt to print pages that don't exist., a=testonly
commit11ba1a7acdf38c4a6056bc0f965bee9726620166
authorMorten Stenshorne <mstensho@chromium.org>
Thu, 23 Nov 2023 08:50:06 +0000 (23 08:50 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Sun, 26 Nov 2023 18:05:40 +0000 (26 18:05 +0000)
treec044c95eb2d9681bc3f0db9eaabe040f9e0b5f62
parent5c512ba8b6e3722c45b288096135cf7e52ec17e4
Bug 1865833 [wpt PR 43284] - Don't attempt to print pages that don't exist., a=testonly

Automatic update from web-platform-tests
Don't attempt to print pages that don't exist.

Due to underlying bugs [1], we may re-layout after having generated the
paginated layout, but before actually printing all the pages. If this
re-layout reduces the number of pages, we would crash, since we assumed
that the page count doesn't change under our feet (which should be a
reasonable assumption, but no). Just bail if requested to print a page
out of range.

Don't store the page count in the PrintContext object, since it may be
old news before we use it, thanks to the bugginess. Still need to store
it for plug-in contexts, though.

[1] crbug.com/452672

Bug: 1503093
Change-Id: Iaa9f3eacfc6a4687b0bfd9edfe55ee13dd23c75e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5049031
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1227511}

--

wpt-commits: 934d3ba105861f4342eee4c79c2932b0e7204fa4
wpt-pr: 43284
testing/web-platform/tests/css/css-page/crashtests/match-media-listener-shrink-content-print.html [new file with mode: 0644]