diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/resources/dirname.js')
-rw-r--r-- | testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/resources/dirname.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/resources/dirname.js b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/resources/dirname.js new file mode 100644 index 0000000000..f0e97bc301 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/forms/attributes-common-to-form-controls/resources/dirname.js @@ -0,0 +1,12 @@ +function onIframeLoadedDone(t, cb, selector="iframe") { + const iframe = document.querySelector(selector); + iframe.addEventListener("load", function() { + // The initial about:blank load event can be fired before the form navigation occurs. + // See https://github.com/whatwg/html/issues/490 for more information. + if(iframe.contentWindow.location.href == "about:blank") { return; } + + const params = new URLSearchParams(iframe.contentWindow.location.search); + t.step(() => cb(params)) + t.done(); + }); +} |