tor-browser

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

content-visibility-017.html (1282B)


      1 <!doctype HTML>
      2 <html>
      3 <meta charset="utf8">
      4 <title>Content Visibility: hit testing (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 }
     24 #inner {
     25  margin: 25px;
     26  width: 50px;
     27  height: 50px;
     28  background lightgreen;
     29  will-change: transform;
     30 }
     31 </style>
     32 
     33 <body id="body">
     34 <div id="outer"><div id="inner"></div></div>
     35 </body>
     36 
     37 <script>
     38 async_test((t) => {
     39  const container = document.getElementById("outer");
     40 
     41  let target = document.elementFromPoint(50, 50);
     42  t.step(() => assert_equals(target.id, "outer", "center hits outer"));
     43  target = document.elementFromPoint(10, 50);
     44  t.step(() => assert_equals(target.id, "outer", "edge hits outer"));
     45  target = document.elementFromPoint(100, 50);
     46  t.step(() => assert_equals(target.id, "body", "elsewhere hits body"));
     47  t.done();
     48 });
     49 
     50 </script>
     51 </html>