wpt / css / css-page / page-margin-auto-and-non-zero-print.html

Status: FAIL | Duration: 44ms | Subtests: 0/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-page/page-margin-auto-and-non-zero-print.html

<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-page-3/#page-properties">
<link rel="match" href="page-margin-auto-and-non-zero-print-ref.html">
<style>
  @page {
    size: 20em 7em;
    border: solid;
    margin: 30px;
  }
  @page aaa { }
  @page bbb {
    margin-top: auto;
  }
  @page ccc {
    margin-bottom: auto;
  }
  @page ddd {
    margin-top: auto;
    margin-left: auto;
  }
  @page eee {
    margin-top: auto;
    margin-right: auto;
  }
  @page fff {
    margin-bottom: auto;
    margin-right: auto;
  }
  :root {
    print-color-adjust: exact;
  }
  body {
    margin: 0;
    background: yellow;
  }
</style>
<div style="page:aaa;">
  center / middle
</div>
<div style="page:bbb;">
  center / top
</div>
<div style="page:ccc;">
  center / bottom
</div>
<div style="page:ddd;">
  top / left
</div>
<div style="page:eee;">
  top / right
</div>
<div style="page:fff;">
  bottom / right
</div>

/css/css-page/page-margin-auto-and-non-zero-print-ref.html

<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<style>
  @page {
    size: 20em 7em;
    margin: 0;
  }
  :root {
    print-color-adjust: exact;
  }
  .pagebox {
    break-before: page;
    display: flex;
    width: 20em;
    height: 7em;
  }
  .pagebox > div {
    flex: 1;
    margin: 30px;
    border: solid;
    background: yellow;
  }
  body {
    margin: 0;
  }
</style>
<div class="pagebox">
  <div>center / middle</div>
</div>
<div class="pagebox">
  <div style="margin-top:0;">center / top</div>
</div>
<div class="pagebox">
  <div style="margin-bottom:0;">center / bottom</div>
</div>
<div class="pagebox">
  <div style="margin-top:0; margin-left:0;">top / left</div>
</div>
<div class="pagebox">
  <div style="margin-top:0; margin-right:0;">top / right</div>
</div>
<div class="pagebox">
  <div style="margin-bottom:0; margin-right:0;">bottom / right</div>
</div>