tor-browser

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

content-visibility-018.html (1326B)


      1 <!doctype HTML>
      2 <html>
      3 <meta charset="utf8">
      4 <title>Content Visibility: hit testing (composited with a composited child)</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="content-visibility hidden prevents hit-testing in the subtree">
      8 
      9 <script src="/resources/testharness.js"></script>
     10 <script src="/resources/testharnessreport.js"></script>
     11 
     12 <style>
     13 body {
     14  margin: 0;
     15  padding: 0;
     16 }
     17 #outer {
     18  width: 100px;
     19  height: 100px;
     20  background: lightblue;
     21 
     22  content-visibility: hidden;
     23  will-change: transform;
     24 }
     25 #inner {
     26  margin: 25px;
     27  width: 50px;
     28  height: 50px;
     29  background lightgreen;
     30  will-change: transform;
     31 }
     32 </style>
     33 
     34 <body id="body">
     35 <div id="outer"><div id="inner"></div></div>
     36 </body>
     37 
     38 <script>
     39 async_test((t) => {
     40  const container = document.getElementById("outer");
     41 
     42  let target = document.elementFromPoint(50, 50);
     43  t.step(() => assert_equals(target.id, "outer", "center hits outer"));
     44  target = document.elementFromPoint(10, 50);
     45  t.step(() => assert_equals(target.id, "outer", "edge hits outer"));
     46  target = document.elementFromPoint(100, 50);
     47  t.step(() => assert_equals(target.id, "body", "elsewhere hits body"));
     48  t.done();
     49 });
     50 
     51 </script>
     52 </html>