summaryrefslogtreecommitdiffstats
path: root/dom/base/test/file_focus_design_mode_inner.html
blob: 43e24652ab689240a4b3362d812e21495d7278a2 (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
28
29
30
31
32
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>activeElement design-mode inner document</title>
</head>
<body>
<h1>Inner</h1>
<script>
let innerlog = "innerlog:";

document.designmode = "on";

window.onmessage = function(e) {
  if (e.data == "focus") {
    document.documentElement.focus();
  } else if (e.data == "getlog") {
    innerlog += "activeElement:" + document.activeElement.tagName + ",";
    parent.postMessage(innerlog, "*");
  }
};

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

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