summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/focus/support/focus-event-after-focusing-iframes-inner.html
blob: cb154160db4be8bf52ea9db27321d737640b9515 (plain)
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
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Focus event inner document</title>
</head>
<body>
<h1>Inner</h1>
<script>
let innerlog = "innerlog:";

window.onmessage = function(e) {
  if (e.data == "getlog") {
    parent.postMessage(innerlog, "*");
  }
};

window.onfocus = function() {
  innerlog += "windowfocus,";
};

window.onblur = function() {
  innerlog += "windowblur,";
};
</script>
</body>
</html>