tor-browser

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

clip-path-path-with-zoom-hittest.html (933B)


      1 <!DOCTYPE html>
      2 <title>CSS Masking: Test clip-path property hit-testing when the page is zoomed</title>
      3 <link rel="author" title="Noam Rosenthal" href="mailto:noam@webkit.org">
      4 <link rel="help" href="https://drafts.csswg.org/css-shapes-2/#funcdef-path">
      5 <meta name="assert" content="The zoomed path is hit-tested correctly">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <style>
      9  #triangle {
     10    width: 100px;
     11    height: 100px;
     12    background-color: green;
     13    clip-path: path(nonzero, 'M0,0 L100,0  L0,100  L0,0');
     14    zoom: 2;
     15  }
     16 </style>
     17 <div id="triangle"></div>
     18 <script>
     19  test(() => {
     20    assert_equals(document.elementFromPoint(20, 20).id, 'triangle')
     21    assert_equals(document.elementFromPoint(150, 20).id, 'triangle')
     22    assert_equals(document.elementFromPoint(180, 180).tagName, 'BODY')
     23  }, 'clip-path: path() hit-test takes zoom into account');
     24 
     25 </script>