summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/events/EventListener-incumbent-global-subsubframe.sub.html
blob: dd683f6f65f89f097ca70594e4a02c2027fdb66b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!DOCTYPE html>
<script>
  function getTheListener() {
    return postMessage.bind(this, "respond", "*", undefined)
  }
  document.domain = "{{host}}";
  onmessage = function (e) {
    if (e.data == "sendclick") {
      document.body.click();
    } else {
      parent.postMessage(
        {
          actual: e.origin,
          expected: parent.location.origin,
          reason: "Incumbent should have been the caller of addEventListener()"
        },
        "*")
    };
  }
</script>