tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_rules_mark_overridden_05.js (950B)


      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 // order of the property.
      8 
      9 const TEST_URI = `
     10  <style type='text/css'>
     11  #testid {
     12    background-color: green;
     13  }
     14  </style>
     15  <div id='testid' class='testclass'>Styled Node</div>
     16 `;
     17 
     18 add_task(async function () {
     19  await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
     20  const { inspector, view } = await openRuleView();
     21  await selectNode("#testid", inspector);
     22 
     23  await addProperty(view, 1, "background-color", "red");
     24 
     25  const firstProp = getTextProperty(view, 1, { "background-color": "green" });
     26  const secondProp = getTextProperty(view, 1, { "background-color": "red" });
     27 
     28  ok(firstProp.overridden, "First property should be overridden.");
     29  ok(!secondProp.overridden, "Second property should not be overridden.");
     30 });