File: include-frames-subframe.html

package info (click to toggle)
firefox 147.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,683,484 kB
  • sloc: cpp: 7,607,246; javascript: 6,533,185; ansic: 3,775,227; python: 1,415,393; xml: 634,561; asm: 438,951; java: 186,241; sh: 62,752; makefile: 18,079; objc: 13,092; perl: 12,808; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10; exp: 6
file content (43 lines) | stat: -rw-r--r-- 1,266 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>

<head>
</head>
<!--
  This html is embedded as a sub-frame in include-frames-originA-B-A.html,
  include-frames-originA-B-B.html and include-frames-originA-A-A.html. Once embedded,
  this would take a url parameter named origin which is the origin of the child frame
  this html is to load in step 3 listed below.
  It does,
  1, waits for load.
  2, creates a single mark performance entry.
  3, creates and loads a child frame, and waits for it to load.
  4. verify entries obtained from this frame.
-->

<body>
  <script>
    (async () => {
      // Wait for load.
      await new Promise(resolve => window.addEventListener("load", resolve));

      // Mark.
      performance.mark("mark_subframe");

      // Create and load an iframe and wait for load.
      await new Promise(resolve => {
        const childFrame = document.createElement('iframe');

        childFrame.addEventListener('load', async () => {
          window.parent.postMessage('Load completed', "*");
          resolve();
        });

        childFrame.src = (new URL(document.location)).searchParams.get('origin')
          + '/performance-timeline/resources/child-frame.html';

        document.body.appendChild(childFrame);
      }
      );
    })();
  </script>
</body>