tor-browser

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

browser_rules_edit-variable-add.js (842B)


      1 /* Any copyright is dedicated to the Public Domain.
      2   http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Test adding a CSS variable.
      7 
      8 const TEST_URI = `
      9  <style type='text/css'>
     10    div {
     11      color: var(--color);
     12    }
     13  </style>
     14  <div></div>
     15 `;
     16 
     17 add_task(async function () {
     18  await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
     19  const { inspector, view } = await openRuleView();
     20  await selectNode("div", inspector);
     21 
     22  info("Check the initial state of --color which refers to an unset variable");
     23  checkCSSVariableOutput(
     24    view,
     25    "div",
     26    "color",
     27    "inspector-unmatched",
     28    "--color is not set"
     29  );
     30 
     31  info("Add the --color CSS variable");
     32  await addProperty(view, 0, "--color", "lime");
     33  checkCSSVariableOutput(view, "div", "color", "inspector-variable", "lime");
     34 });