browser_rules_inactive_css_split-condition.js (800B)
1 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */ 2 /* Any copyright is dedicated to the Public Domain. 3 http://creativecommons.org/publicdomain/zero/1.0/ */ 4 5 "use strict"; 6 7 // Test that a CSS property is marked as inactive when a condition 8 // changes in other CSS rule matching the element. 9 10 const TEST_URI = ` 11 <style> 12 .display { 13 display: grid; 14 } 15 .gap { 16 gap: 1em; 17 } 18 </style> 19 <div class="display gap">`; 20 21 add_task(async function () { 22 await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI)); 23 const { inspector, view } = await openRuleView(); 24 25 await selectNode("div", inspector); 26 27 await checkDeclarationIsActive(view, 1, { gap: "1em" }); 28 await toggleDeclaration(view, 2, { display: "grid" }); 29 await checkDeclarationIsInactive(view, 1, { gap: "1em" }); 30 });