tor-browser

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

content-visibility-auto-state-changed-removed.html (1257B)


      1 <!doctype HTML>
      2 <html>
      3 <meta charset="utf8">
      4 <title>Content Visibility: ContentVisibilityAutoStateChange event.</title>
      5 <link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
      6 <link rel="help" href="https://drafts.csswg.org/css-contain/#content-visibility">
      7 <meta name="assert" content="ContentVisibilityAutoStateChange does not fire on disconnected element">
      8 
      9 <script src="/resources/testharness.js"></script>
     10 <script src="/resources/testharnessreport.js"></script>
     11 <script src="/common/rendering-utils.js"></script>
     12 
     13 <style>
     14 .spacer {
     15  height: 10000px;
     16 }
     17 #bottomdiv {
     18  content-visibility: auto;
     19 }
     20 </style>
     21 
     22 <div class=spacer></div>
     23 <div id=bottomdiv></div>
     24 
     25 <script>
     26 promise_test(t => new Promise(async (resolve, reject) => {
     27  // Make sure the first "contentvisibilityautostatechange" event has fired before the test.
     28  await new Promise(resolve => bottomdiv.addEventListener("contentvisibilityautostatechange", resolve, { once: true }));
     29 
     30  let observed = false;
     31  bottomdiv.addEventListener("contentvisibilityautostatechange", () => {
     32    reject("unexpected signal")
     33  });
     34 
     35  bottomdiv.remove()
     36  waitForAtLeastOneFrame().then(resolve);
     37 
     38 }), "ContentVisibilityAutoStateChange does not fire on disconnected element");
     39 
     40 </script>