block-container-properties.mjs (1688B)
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 container test cases. 6 const tests = []; 7 const properties = ["text-overflow"]; 8 properties.forEach(property => { 9 tests.push( 10 ...createDisplayTests( 11 property, 12 [ 13 "block", 14 "block ruby", 15 "flow-root", 16 "flow-root list-item", 17 "inline flow-root list-item", 18 "inline-block", 19 "list-item", 20 "table-caption", 21 "table-cell", 22 ], 23 true 24 ), 25 ...createDisplayTests( 26 property, 27 [ 28 "contents", 29 "flex", 30 "grid", 31 "inline", 32 "inline list-item", 33 "inline-flex", 34 "inline-grid", 35 "inline-table", 36 "none", 37 "ruby", 38 "ruby-base", 39 "ruby-base-container", 40 "ruby-text", 41 "ruby-text-container", 42 "table", 43 "table-column", 44 "table-column-group", 45 "table-footer-group", 46 "table-header-group", 47 "table-row", 48 "table-row-group", 49 ], 50 false 51 ) 52 ); 53 }); 54 55 function createDisplayTests(property, displayValues, active) { 56 return displayValues.map(displayValue => { 57 return { 58 info: `${property} is ${ 59 active ? "active" : "inactive" 60 } on an element with display: ${displayValue}`, 61 property, 62 tagName: "div", 63 rules: [ 64 `div { display: ${displayValue}; overflow: hidden; ${property}: initial; }`, 65 ], 66 isActive: active, 67 }; 68 }); 69 } 70 71 export default tests;