tor-browser

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

browser_rules_invalid.js (871B)


      1 /* Any copyright is dedicated to the Public Domain.
      2 http://creativecommons.org/publicdomain/zero/1.0/ */
      3 
      4 "use strict";
      5 
      6 // Test that an invalid property still lets us display the rule view
      7 // Bug 1235603.
      8 
      9 const TEST_URI = `
     10  <style>
     11    div {
     12        background: #fff;
     13        font-family: sans-serif;
     14        url(display-table.min.htc);
     15    }
     16 </style>
     17 <body>
     18    <div id="testid" class="testclass">Styled Node</div>
     19 </body>
     20 `;
     21 
     22 add_task(async function () {
     23  await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
     24 
     25  const { inspector, view } = await openRuleView();
     26  await selectNode("#testid", inspector);
     27 
     28  is(view._elementStyle.rules.length, 2, "Should have 2 rules.");
     29  // Have to actually get the rule in order to ensure that the
     30  // elements were created.
     31  ok(getRuleViewRule(view, "div"), "Rule with div selector exists");
     32 });