gap-normal-computed-001.html (2505B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Box Alignment Test: computed value of normal on *-gap properties</title> 4 <link rel="author" title="Florian Rivoal" href="https://florian.rivoal.net"> 5 <link rel="help" href="https://www.w3.org/TR/css-align-3/#column-row-gap"> 6 <meta assert="The computed value of [row-|column-]?gap is normal for all elements it applies to. Checking explicitely because earlier version of the spec called for 0px in some cases."> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <style> 10 #col, 11 #grid, 12 #flex { 13 /* Not using the shorthand because that's not what we're interested in, 14 and there are implementations that support column-gap without supporting the shorthand */ 15 colum-gap: normal; 16 row-gap: normal; 17 float: right; /* for shrinkwrap*/ 18 } 19 #col { 20 column-count: 2; 21 column-width: 50px; 22 } 23 #grid { 24 display: grid; 25 grid-template-columns: 50px 50px; 26 grid-template-rows: 50px 50px; 27 } 28 #flex { 29 display: flex; 30 } 31 #flex * { width: 50px; height: 50px;} 32 </style> 33 <body> 34 <div id="log"></div> 35 36 <div id=col></div> 37 <div id=grid></div> 38 <div id=flex><span></span><span></span></div> 39 40 <script> 41 test( 42 function(){ 43 var target = document.getElementById("col"); 44 assert_equals(getComputedStyle(target).columnGap, "normal"); 45 }, "colum-gap:normal computes to normal on multicol elements"); 46 test( 47 function(){ 48 var target = document.getElementById("col"); 49 assert_equals(getComputedStyle(target).rowGap, "normal"); 50 }, "row-gap:normal computes to normal on multicol elements"); 51 test( 52 function(){ 53 var target = document.getElementById("grid"); 54 assert_equals(getComputedStyle(target).columnGap, "normal"); 55 }, "colum-gap:normal computes to normal on grid"); 56 test( 57 function(){ 58 var target = document.getElementById("grid"); 59 assert_equals(getComputedStyle(target).rowGap, "normal"); 60 }, "row-gap:normal computes to normal on grid"); 61 test( 62 function(){ 63 var target = document.getElementById("flex"); 64 assert_equals(getComputedStyle(target).columnGap, "normal"); 65 }, "colum-gap:normal (main axis) computes to normal on flexbox"); 66 test( 67 function(){ 68 var target = document.getElementById("flex"); 69 assert_equals(getComputedStyle(target).rowGap, "normal"); 70 }, "row-gap:normal (cross axis) computes to normal on flexbox"); 71 </script> 72 </body>