Bug 502818 - Property access on DOMMouseScroll events does not propagate to Event.prototype, r+sr=jst
--- a/content/events/test/Makefile.in
+++ b/content/events/test/Makefile.in
@@ -71,16 +71,17 @@ include $(topsrcdir)/config/rules.mk
test_bug456273.html \
test_bug457672.html \
test_bug428988.html \
bug457672.html \
test_draggableprop.html \
test_dragstart.html \
test_bug489671.html \
test_bug493251.html \
+ test_bug502818.html \
$(NULL)
_CHROME_FILES = \
test_bug415498.xul \
bug415498-doc1.html \
bug415498-doc2.html \
$(NULL)
new file mode 100644
--- /dev/null
+++ b/content/events/test/test_bug502818.html
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=502818
+-->
+<head>
+ <title>Test for Bug 502818</title>
+ <script type="application/javascript" src="/MochiKit/packed.js"></script>
+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=502818">Mozilla Bug 502818</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+
+</div>
+<pre id="test">
+<script type="application/javascript">
+
+/** Test for Bug 502818 **/
+
+ var count = 0;
+
+ function listener(evt) {
+ ++count;
+ is(evt.foo, 'bar', "Event.prototype should be accessible from " + evt.type);
+ }
+
+ Event.prototype.foo = 'bar';
+ window.addEventListener('DOMMouseScroll', listener, false);
+ window.addEventListener('MozMousePixelScroll', listener, false);
+ window.addEventListener('foobar', listener, false);
+
+ var e = document.createEvent("mousescrollevents");
+ e.initMouseScrollEvent("DOMMouseScroll", true, true, window,
+ 0, 0, 0, 0, 0, false, false, false, false,
+ 0, null, 1);
+ window.dispatchEvent(e);
+
+ e.initMouseScrollEvent("MozMousePixelScroll", true, true, window,
+ 0, 0, 0, 0, 0, false, false, false, false,
+ 0, null, 1);
+ window.dispatchEvent(e);
+
+ e.initMouseScrollEvent("foobar", true, true, window,
+ 0, 0, 0, 0, 0, false, false, false, false,
+ 0, null, 1);
+ window.dispatchEvent(e);
+
+ is(count, 3, "Wrong number tests run!");
+</script>
+</pre>
+</body>
+</html>
--- a/dom/interfaces/events/nsIDOMMouseScrollEvent.idl
+++ b/dom/interfaces/events/nsIDOMMouseScrollEvent.idl
@@ -31,20 +31,20 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-#include "domstubs.idl"
+#include "nsIDOMMouseEvent.idl"
-[scriptable, uuid(f172af88-48c3-4989-b814-60449823fc7d)]
-interface nsIDOMMouseScrollEvent : nsISupports
+[scriptable, uuid(ba8d1a7e-b475-4542-8d32-01e7ea7b8091)]
+interface nsIDOMMouseScrollEvent : nsIDOMMouseEvent
{
const long HORIZONTAL_AXIS = 1;
const long VERTICAL_AXIS = 2;
readonly attribute long axis;
void initMouseScrollEvent(in DOMString typeArg,
in boolean canBubbleArg,