tor-browser

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

cssimportrule-sheet-identity.html (1072B)


      1 <!doctype html>
      2 <title>CSSImportRule has different sheets even if referencing the same URL</title>
      3 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <link rel="help" href="https://drafts.csswg.org/cssom/#the-cssimportrule-interface">
      7 <link rel="stylesheet" href="support/import-rule.css">
      8 <link rel="stylesheet" href="support/import-rule.css">
      9 <script>
     10 let t = async_test("CSSImportRule has different sheets even if referencing the same URL");
     11 window.onload = t.step_func_done(function() {
     12  let sheet1 = document.styleSheets[0];
     13  let sheet2 = document.styleSheets[1];
     14 
     15  assert_not_equals(sheet1, sheet2);
     16 
     17  let childSheet1 = sheet1.cssRules[0].styleSheet;
     18  let childSheet2 = sheet2.cssRules[0].styleSheet;
     19 
     20  assert_not_equals(childSheet1, null);
     21  assert_not_equals(childSheet2, null);
     22  assert_not_equals(childSheet1, childSheet2, "@import pointing to the same URL shouldn't point to the same StyleSheet object");
     23 });
     24 </script>