browser_rules_mark_overridden_03.js (1008B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 // Tests that the rule view marks overridden rules correctly based on the 7 // priority for the rule 8 9 const TEST_URI = ` 10 <style type='text/css'> 11 #testid { 12 background-color: blue; 13 } 14 .testclass { 15 background-color: green !important; 16 } 17 </style> 18 <div id='testid' class='testclass'>Styled Node</div> 19 `; 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 await selectNode("#testid", inspector); 25 26 const idProp = getTextProperty(view, 1, { "background-color": "blue" }); 27 ok(idProp.overridden, "Not-important rule should be overridden."); 28 29 const classProp = getTextProperty(view, 2, { "background-color": "green" }); 30 ok(!classProp.overridden, "Important rule should not be overridden."); 31 32 ok(idProp.overridden, "ID property should be overridden."); 33 });