Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 10 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /resource-timing/tentative/initiator-url/static-resource.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Resource Timing - initiatorUrl for resources loaded statically by the document</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resource-timing/resources/observe-entry.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="../../resources/test-initiator.js"></script>
<!-- Empty Blocking Script -->
<script src="../../resources/empty.js?blocking"></script>
<!-- Empty Preloaded Script -->
<link rel="preload" href="../../resources/display_paragraph.js" as="script">
<!-- Loading arbitrary Empty Blocking Async Script -->
<script async src="../../resources/empty.js?async"></script>
<!-- Loading arbitrary Empty Deferred Script -->
<script defer src="../../resources/empty.js?deferred"></script>
<!-- Loading arbitrary Empty Module Script -->
<script type="module" src="../../resources/empty.js?module"></script>
<!-- Empty Stylesheet -->
<link rel="stylesheet" href="../../resources/empty_style.css?link">
<script src="../../resources/display_paragraph.js"></script>
<!-- Inline Styles -->
<style>
body {
background-image: url("/images/blue.png?inline-style");
font-family: remoteFont, sans-serif;
}
@font-face {
font-family: remoteFont;
/* This query parameter ensures that the Ahem.ttf is not retrieved from the
cache. */
src: url("/fonts/Ahem.ttf?initiator-html");
}
</style>
<!-- Loading an arbitrary Image using <img> tag -->
<img src="/images/blue.png?using-Img-tag"
alt="Sample Image for testing initiator Attribute">
<iframe src="../../resources/green.html"></iframe>
<script>
display_paragraph();
const expectedInitiatorUrl = getUrl(
"/resource-timing/tentative/initiator-url/static-resource.html");
const resources = [
"empty.js?blocking",
"display_paragraph.js",
"empty.js?async",
"empty.js?deferred",
"empty.js?module",
"empty_style.css?link",
"blue.png?inline-style",
"Ahem.ttf?initiator-html",
"blue.png?using-Img-tag",
"green.html",
];
for (const resource of resources) {
initiator_url_test(resource, expectedInitiatorUrl, resource +
" initiatorUrl from static-resource", resource + " timeout");
}
</script>