summaryrefslogtreecommitdiffstats
path: root/dom/tests/html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/tests/html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-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 'dom/tests/html')
-rw-r--r--dom/tests/html/jshandlers.html76
1 files changed, 76 insertions, 0 deletions
diff --git a/dom/tests/html/jshandlers.html b/dom/tests/html/jshandlers.html
new file mode 100644
index 000000000..6f96606f2
--- /dev/null
+++ b/dom/tests/html/jshandlers.html
@@ -0,0 +1,76 @@
+<html>
+<body>
+The link below has an onmousedown, an onmouseup, and an onmousemove handler.
+Mouseover or click for event info in debug console.
+<a href="jshandlers.html">Link back to this page</a>
+
+<p>The link below has an event that should open www.mozilla.org when
+ clicked
+</p>
+<!-- The link does 'return 0' - as per bug 345521 this should *not* be
+ interpreted as false
+-->
+<a href="http://www.mozilla.org" onclick="return 0">Click me</a>
+
+<p>The link below has an event that is cancelled - nothing should happen when
+ clicked
+</p>
+<a href="http://www.mozilla.org" onclick="return false">Click me<a/>
+
+</body>
+<script>
+function findElementByTagName(start, tag)
+{
+ var type = start.nodeType;
+
+ if (type == Node.ELEMENT) {
+
+ if (tag == start.tagName) {
+ //dump ("found one\n");
+ return start;
+ }
+
+ if (start.hasChildNodes) {
+ var children = start.childNodes;
+ var length = children.length;
+ var count = 0;
+ while(count < length) {
+ var ret = findElementByTagName(children[count], tag)
+ if (null != ret) {
+ return ret;
+ }
+ count++;
+ }
+ }
+ }
+ return null;
+}
+
+function getFirstLink()
+{
+ var node = document.documentElement;
+ var ret = findElementByTagName(node, "A");
+ return ret;
+}
+
+function ondown()
+{
+ dump("got mousedown in script\n");
+}
+
+function onup()
+{
+ dump("got mouseup in script\n");
+}
+
+function onmove(event)
+{
+ dump("got mousemove in script at "+event.clientX+", "+event.clientY+"\n");
+}
+
+var l = getFirstLink();
+l.onmousedown = ondown;
+l.onmouseup = onup;
+l.onmousemove = onmove;
+</script>
+</html>