table.mjs (1238B)
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 `border-collapse`, `border-spacing`, 6 // `table-layout` test cases. 7 export default [ 8 ...createTestsForProp("border-collapse", "collapse"), 9 ...createTestsForProp("border-spacing", "10px"), 10 ...createTestsForProp("table-layout", "fixed"), 11 ]; 12 13 function createTestsForProp(propertyName, propertyValue) { 14 return [ 15 { 16 info: `${propertyName} is inactive on block element`, 17 property: propertyName, 18 tagName: "div", 19 rules: [`div { ${propertyName}: ${propertyValue}; }`], 20 isActive: false, 21 }, 22 { 23 info: `${propertyName} is active on table element`, 24 property: propertyName, 25 tagName: "div", 26 rules: [`div { display: table; ${propertyName}: ${propertyValue}; }`], 27 isActive: true, 28 }, 29 { 30 info: `${propertyName} is active on inline table element`, 31 property: propertyName, 32 tagName: "div", 33 rules: [ 34 `div { display: inline-table; ${propertyName}: ${propertyValue}; }`, 35 ], 36 isActive: true, 37 }, 38 ]; 39 }