tor-browser

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

browser_rules_inactive_css_display-justify.js (1512B)


      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 declaration's inactive state doesn't linger on its previous state when
      8 // the declaration it depends on changes. Bug 1593944
      9 
     10 const TEST_URI = `
     11 <style>
     12  div {
     13    justify-content: center;
     14    /*! display: flex */
     15  }
     16 </style>
     17 <div>`;
     18 
     19 add_task(async function () {
     20  await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
     21  const { inspector, view } = await openRuleView();
     22 
     23  await selectNode("div", inspector);
     24 
     25  const justifyContent = { "justify-content": "center" };
     26  const justifyItems = { "justify-items": "center" };
     27  const displayFlex = { display: "flex" };
     28  const displayGrid = { display: "grid" };
     29 
     30  info("Enable display:flex and check that justify-content becomes active");
     31  await checkDeclarationIsInactive(view, 1, justifyContent);
     32  await toggleDeclaration(view, 1, displayFlex);
     33  await checkDeclarationIsActive(view, 1, justifyContent);
     34 
     35  info(
     36    "Rename justify-content to justify-items and check that it becomes inactive"
     37  );
     38  await updateDeclaration(view, 1, justifyContent, justifyItems);
     39  await checkDeclarationIsInactive(view, 1, justifyItems);
     40 
     41  info(
     42    "Rename display:flex to display:grid and check that justify-items becomes active"
     43  );
     44  await updateDeclaration(view, 1, displayFlex, displayGrid);
     45  await checkDeclarationIsActive(view, 1, justifyItems);
     46 });