diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /devtools/client/debugger/test/mochitest/doc_event-listeners-03.html | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/debugger/test/mochitest/doc_event-listeners-03.html')
-rw-r--r-- | devtools/client/debugger/test/mochitest/doc_event-listeners-03.html | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/devtools/client/debugger/test/mochitest/doc_event-listeners-03.html b/devtools/client/debugger/test/mochitest/doc_event-listeners-03.html new file mode 100644 index 000000000..b672a4360 --- /dev/null +++ b/devtools/client/debugger/test/mochitest/doc_event-listeners-03.html @@ -0,0 +1,63 @@ +<!-- Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ --> +<!doctype html> +<html> + <head> + <meta charset="utf-8"/> + <title>Bound event listeners test page</title> + </head> + + <body> + <button id="initialSetup">initialSetup</button> + <button id="clicker">clicker</button> + <button id="handleEventClick">handleEventClick</button> + <button id="boundHandleEventClick">boundHandleEventClick</button> + + <script type="text/javascript"> + window.addEventListener("load", function onload() { + window.removeEventListener("load", onload); + function initialSetup(event) { + var button = document.getElementById("initialSetup"); + button.removeEventListener("click", initialSetup); + debugger; + } + + function clicker(event) { + window.foobar = "clicker"; + } + + function handleEventClick() { + var button = document.getElementById("handleEventClick"); + // Create a long prototype chain to test for weird edge cases. + button.addEventListener("click", Object.create(Object.create(this))); + } + + handleEventClick.prototype.handleEvent = function() { + window.foobar = "handleEventClick"; + }; + + function boundHandleEventClick() { + var button = document.getElementById("boundHandleEventClick"); + this.handleEvent = this.handleEvent.bind(this); + button.addEventListener("click", this); + } + + boundHandleEventClick.prototype.handleEvent = function() { + window.foobar = "boundHandleEventClick"; + }; + + var button = document.getElementById("clicker"); + // Bind more than once to test for weird edge cases. + var boundClicker = clicker.bind(this).bind(this).bind(this); + button.addEventListener("click", boundClicker); + + new handleEventClick(); + new boundHandleEventClick(); + + var initButton = document.getElementById("initialSetup"); + initButton.addEventListener("click", initialSetup); + }); + </script> + </body> + +</html> |