Files
sousa-gecko/testing/web-platform/tests/css/css-values/viewport-page-print.html
T
Florian Rivoal d2acb06750 Bug 2026263 [wpt PR 58705] - Add tests for the interraction between viewport units and @page margins, a=testonly
Automatic update from web-platform-tests
Add tests for the interraction between viewport units and @page margins (#58705)

Add tests for the interaction between viewport units and @page margins
--

wpt-commits: 951c8cde9062bb6a308ee51c9c4f96209736f3b7
wpt-pr: 58705
2026-04-09 19:28:19 +00:00

43 lines
1.2 KiB
HTML

<!doctype html>
<html
<meta charset=utf-8>
<title>Viewport units respond to page margins</title>
<link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net/">
<link rel="help" href="https://drafts.csswg.org/css-values-4/#viewport-relative-lengths">
<link rel="match" href="reference/viewport-page-print-ref.html">
<link rel="mismatch" href="reference/viewport-page-print-no-ref.html">
<meta name="assert" content="When the height or width of the initial containing block is changed, viewport units are scaled accordingly, including in paginated mode, when the thing that makes the ICB change is @page margins.">
<!--
This test passes if, when printed,
the page is fully green,
with no red nor white at the edges.
If there is no green,
it likely means background colors have been disabled for printing.
If there is white,
it likely means that '@page { margin: 0; }' did not take effect.
If there is red,
it likely means that '@page { margin: 0; }' did take effect,
but that the 'vh' and 'vw' units were not recomputed accordingly.
-->
<style>
body {
margin: 0;
}
:root {
background: red;
}
@page {
margin: 0;
}
div {
background: green;
width: 100vw;
height: 100vh;
}
</style>
<div></div>