diff options
Diffstat (limited to 'testing/web-platform/tests/html/interaction/focus/the-autofocus-attribute/resources/grand-child-autofocus.html')
-rw-r--r-- | testing/web-platform/tests/html/interaction/focus/the-autofocus-attribute/resources/grand-child-autofocus.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/interaction/focus/the-autofocus-attribute/resources/grand-child-autofocus.html b/testing/web-platform/tests/html/interaction/focus/the-autofocus-attribute/resources/grand-child-autofocus.html new file mode 100644 index 0000000000..88be6e0b04 --- /dev/null +++ b/testing/web-platform/tests/html/interaction/focus/the-autofocus-attribute/resources/grand-child-autofocus.html @@ -0,0 +1,18 @@ +<!DOCTYPE html> +<input id="target" value="This should be focused!" autofocus></input> + +<script> + let got_focus = false; + target.addEventListener("focus", () => got_focus = true); + + window.addEventListener("load", () => { + parent.postMessage("grand_child_loaded", "*"); + }); + + window.addEventListener("message", event => { + if (event.data == "report_focus_state") { + let msg = got_focus ? "grand_child_is_focused" : "grand_child_is_not_focused"; + parent.postMessage(msg, "*"); + } + }); +</script> |