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/inspector/markup/test/doc_markup_events2.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/inspector/markup/test/doc_markup_events2.html')
-rw-r--r-- | devtools/client/inspector/markup/test/doc_markup_events2.html | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/devtools/client/inspector/markup/test/doc_markup_events2.html b/devtools/client/inspector/markup/test/doc_markup_events2.html new file mode 100644 index 000000000..ddc17537d --- /dev/null +++ b/devtools/client/inspector/markup/test/doc_markup_events2.html @@ -0,0 +1,111 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + <style> + #fatarrow, + #bound, + #boundhe, + #comment-inline, + #comment-streaming, + #anon-object-method, + #object-method { + border: 1px solid #000; + width: 200px; + min-height: 1em; + cursor: pointer; + } + </style> + <script type="application/javascript;version=1.8"> + function init() { + let fatarrow = document.getElementById("fatarrow"); + + let he = new handleEventClick(); + let anonObjectMethod = document.getElementById("anon-object-method"); + anonObjectMethod.addEventListener("click", he.anonObjectMethod); + + let objectMethod = document.getElementById("object-method"); + objectMethod.addEventListener("click", he.objectMethod); + + let bhe = new boundHandleEventClick(); + let boundheNode = document.getElementById("boundhe"); + bhe.handleEvent = bhe.handleEvent.bind(bhe); + boundheNode.addEventListener("click", bhe); + + let boundNode = document.getElementById("bound"); + boundClickHandler = boundClickHandler.bind(this); + boundNode.addEventListener("click", boundClickHandler); + + fatarrow.addEventListener("click", () => { + alert("Fat arrow without params!"); + }); + + fatarrow.addEventListener("click", event => { + alert("Fat arrow with 1 param!"); + }); + + fatarrow.addEventListener("click", (event, foo, bar) => { + alert("Fat arrow with 3 params!"); + }); + + fatarrow.addEventListener("click", b => b); + + let inlineCommentNode = document.getElementById("comment-inline"); + inlineCommentNode + .addEventListener("click", functionProceededByInlineComment); + + let streamingCommentNode = document.getElementById("comment-streaming"); + streamingCommentNode + .addEventListener("click", functionProceededByStreamingComment); + } + + function boundClickHandler(event) { + alert("Bound event"); + } + + function handleEventClick(hehe) { + + } + + handleEventClick.prototype = { + anonObjectMethod: function() { + alert("obj.anonObjectMethod"); + }, + + objectMethod: function kay() { + alert("obj.objectMethod"); + }, + }; + + function boundHandleEventClick() { + + } + + boundHandleEventClick.prototype = { + handleEvent: function() { + alert("boundHandleEvent"); + } + }; + + // A function proceeded with an inline comment + function functionProceededByInlineComment() { + alert("comment-inline"); + } + + /* A function proceeded with a streaming comment */ + function functionProceededByStreamingComment() { + alert("comment-streaming"); + } + </script> + </head> + <body onload="init();"> + <h1>Events test 2</h1> + <div id="fatarrow">Fat arrows</div> + <div id="boundhe">Bound handleEvent</div> + <div id="bound">Bound event</div> + <div id="comment-inline">Event proceeded by an inline comment</div> + <div id="comment-streaming">Event proceeded by a streaming comment</div> + <div id="anon-object-method">Anonymous object method</div> + <div id="object-method">Object method</div> + </body> +</html> |