position-absolute-margin-auto-001.html (1034B)
1 <!DOCTYPE html> 2 <title>Tests the calculation of negative auto margins of absolutely positioned element</title> 3 <link rel="help" href="https://drafts.csswg.org/css-position/#abspos-margins"> 4 <link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1492323"> 5 <link rel="author" href="mailto:xiaochengh@chromium.org"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <script src="/resources/check-layout-th.js"></script> 9 <style> 10 .cb { 11 position: relative; 12 width: 400px; 13 height: 400px; 14 outline: 1px dashed black; 15 } 16 17 .target { 18 writing-mode: vertical-lr; 19 position: absolute; 20 background: green; 21 width: calc(100% - 100px); 22 height: calc(100% - 100px); 23 inset: 100px; 24 margin: auto; 25 } 26 </style> 27 28 <body onload="checkLayout('.target')"> 29 <div class="cb"> 30 <div class="target" 31 data-expected-margin-top="-50" data-expected-margin-bottom="-50" 32 data-expected-margin-left="0" data-expected-margin-right="-100"></div> 33 </div> 34 </body>