diff options
Diffstat (limited to '')
-rw-r--r-- | devtools/client/inspector/markup/test/doc_markup_events_jquery.html | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/devtools/client/inspector/markup/test/doc_markup_events_jquery.html b/devtools/client/inspector/markup/test/doc_markup_events_jquery.html new file mode 100644 index 0000000000..efcb51c667 --- /dev/null +++ b/devtools/client/inspector/markup/test/doc_markup_events_jquery.html @@ -0,0 +1,79 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + + <style> + input { + margin: 5px 3px 10px 10px; + } + + div { + width: 100px; + height: 100px; + border: 1px solid #000; + } + </style> + + <script type="application/javascript"> + "use strict"; + + const jq = document.location.search.substr(1); + const script = document.createElement("script"); + script.setAttribute("type", "text/javascript"); + script.setAttribute("src", jq); + document.head.appendChild(script); + + // If you update the content of the callback, remember to + // update helper_events_test_runner.js `getDocMarkupEventsJQueryLoadHandlerText`. + window.addEventListener("load", () => { + const handler1 = function liveDivDblClick() { alert(1); }; + const handler2 = function liveDivDragStart() { alert(2); }; + const handler3 = function liveDivDragLeave() { alert(3); }; + const handler4 = function liveDivDragEnd() { alert(4); }; + const handler5 = function liveDivDrop() { alert(5); }; + const handler6 = function liveDivDragOver() { alert(6); }; + const handler7 = function divClick1() { alert(7); }; + const handler8 = function divClick2() { alert(8); }; + const handler9 = function divKeyDown() { alert(9); }; + const handler10 = function divDragOut() { alert(10); }; + + if ($("#livediv").live) { + $("#livediv").live( "dblclick", handler1); + $("#livediv").live( "dragstart", handler2); + } + + if ($("#livediv").delegate) { + $(document).delegate( "#livediv", "dragleave", handler3); + $(document).delegate( "#livediv", "dragend", handler4); + } + + if ($("#livediv").on) { + $(document).on( "drop", "#livediv", handler5); + $(document).on( "dragover", "#livediv", handler6); + $(document).on( "dragout", "#livediv:xxxxx", handler10); + } + + const div = $("div")[0]; + $(div).click(handler7); + $(div).click(handler8); + $(div).keydown(handler9); + + class MyClass { + constructor() { + $(document).on("click", '#inclassboundeventdiv', this.onClick.bind(this)); + } + onClick() { alert(11); } + } + new MyClass(); + }); + </script> + </head> + <body> + <div id="testdiv"></div> + <br> + <div id="livediv"></div> + <br> + <div id="inclassboundeventdiv"></div> + </body> +</html> |