block-flex-grid-container-properties.mjs (1777B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 // InactivePropertyHelper: block, flex, and grid container test cases. 6 const tests = []; 7 const properties = [ 8 "overflow", 9 "overflow-block", 10 "overflow-inline", 11 "overflow-x", 12 "overflow-y", 13 ]; 14 properties.forEach(property => { 15 tests.push( 16 ...createDisplayTests( 17 property, 18 [ 19 "block", 20 "block ruby", 21 "flex", 22 "flow-root", 23 "flow-root list-item", 24 "grid", 25 "inline flow-root list-item", 26 "inline-block", 27 "inline-flex", 28 "inline-grid", 29 "list-item", 30 "table-caption", 31 "table-cell", 32 ], 33 true 34 ), 35 ...createDisplayTests( 36 property, 37 [ 38 "contents", 39 "inline", 40 "inline list-item", 41 "inline-table", 42 "none", 43 "ruby", 44 "ruby-base", 45 "ruby-base-container", 46 "ruby-text", 47 "ruby-text-container", 48 "table", 49 "table-column", 50 "table-column-group", 51 "table-footer-group", 52 "table-header-group", 53 "table-row", 54 "table-row-group", 55 ], 56 false 57 ) 58 ); 59 }); 60 61 function createDisplayTests(property, displayValues, active) { 62 return displayValues.map(displayValue => { 63 return { 64 info: `${property} is ${ 65 active ? "active" : "inactive" 66 } on an element with display: ${displayValue}`, 67 property, 68 tagName: "div", 69 rules: [ 70 `div { display: ${displayValue}; overflow: hidden; ${property}: initial; }`, 71 ], 72 isActive: active, 73 }; 74 }); 75 } 76 77 export default tests;