tor-browser

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

image-rect-iframe.html (1173B)


      1 <!DOCTYPE HTML>
      2 <meta charset=utf-8>
      3 <title>Element Timing: check intersectionRect for element in iframe</title>
      4 <body>
      5 <style>
      6 body {
      7  margin: 50px;
      8 }
      9 </style>
     10 <script src="/resources/testharness.js"></script>
     11 <script src="/resources/testharnessreport.js"></script>
     12 <script>
     13  async_test((t) => {
     14    assert_implements(window.PerformanceElementTiming, "PerformanceElementTiming is not implemented");
     15    on_event(window, 'message', e => {
     16      assert_equals(e.data.length, 1);
     17      assert_equals(e.data.entryType, 'element');
     18      const rect = e.data.rect;
     19      // rect should start at (0,0) even though main frame has a margin.
     20      assert_equals(rect.left, 0);
     21      assert_equals(rect.right, 100);
     22      assert_equals(rect.top, 0);
     23      assert_equals(rect.bottom, 100);
     24      assert_equals(e.data.naturalWidth, 100);
     25      assert_equals(e.data.naturalHeight, 100);
     26      assert_equals(e.data.id, 'iframe_img_id');
     27      assert_equals(e.data.elementId, 'iframe_img_id');
     28      t.done();
     29    });
     30  }, 'Element Timing entry in iframe has coordinates relative to the iframe.');
     31 </script>
     32 <iframe src="resources/iframe-with-square-sends-entry.html"></iframe>
     33 </body>