flexbox-column-style-change-triggers-layout-block-start.html (1227B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <link rel="author" href="mailto:sammy.gill@apple.com"> 5 <link rel="help" href="https://drafts.csswg.org/css-box-4/#margin-trim-flex"> 6 <meta name="assert" content="Make sure margins are no longer trimmed when margin-trim is changed to none on the flexbox"> 7 <style> 8 flexbox { 9 display: flex; 10 flex-direction: column; 11 width: min-content; 12 margin-trim: block-start; 13 } 14 item { 15 display: block; 16 background-color: green; 17 width: 50px; 18 height: 50px; 19 margin-block-start: 10px; 20 } 21 </style> 22 <script src="/resources/testharness.js"></script> 23 <script src="/resources/testharnessreport.js"></script> 24 <script src="/resources/check-layout-th.js"></script> 25 </head> 26 <body> 27 <div id="target"> 28 <flexbox> 29 <item data-expected-margin-top="10" data-offset-y="18"></item> 30 <item data-expected-margin-top="10" data-offset-y="78"></item> 31 </flexbox> 32 </div> 33 <script> 34 // Force the first layout to trim margins, set margin-trim to none, 35 // force a second layout, and then check to see if the margins were added back 36 document.body.offsetHeight; 37 document.querySelector("flexbox").style["margin-trim"] = "none"; 38 document.body.offsetHeight; 39 checkLayout("flexbox > item"); 40 </script> 41 </body> 42 </html>