Closed Bug 502818 Opened 13 years ago Closed 13 years ago

Property access on "DOMMouseScroll" events does not propagate to `Event.prototype`

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

1.9.1 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta2-fixed

People

(Reporter: kangax, Assigned: smaug)

Details

(Keywords: dev-doc-complete, regression)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5

"DOMMouseScroll" events, while inheriting from `Event.prototype`, fail to resolve properties properly in FF3.5. Extending `Event.prototype` with a property doesn't allow to access that property on "DOMMouseScroll" events, but works as expected with other events such as "click", "mousemove", etc.

Also, see relevant Prototype.js ticket: <>

Reproducible: Always

Steps to Reproduce:
1. Run this simple test case:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  "http://www.w3.org/TR/html4/strict.dtd">
<html>
  <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <title></title>
  </head>
  <body>
    <script type="text/javascript">
      Event.prototype.foo = 'bar';
      window.addEventListener('DOMMouseScroll', function(e) {
        console.log(e.foo);
      }, false);
    </script>
  </body>
</html>

2. Trigger DOMMouseScroll event (e.g. by scrolling mouse wheel) anywhere on a page.

3. Observe `foo` property being logged as `undefined` (and not of "bar" value as defined on `Event.prototype`).
Component: General → Event Handling
Product: Firefox → Core
QA Contact: general → events
Version: unspecified → 1.9.1 Branch
No dupes found. Marking NEW.
Status: UNCONFIRMED → NEW
Ever confirmed: true
I am experiencing this bug in Windows XP as well.

User-Agent:  Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2
Could someone provide a minimal testcase (using 'Add an attachment '), please?
Attached file testcase
Thanks!
Assignee: nobody → Olli.Pettay
Flags: blocking1.9.2?
Keywords: regression
Attached patch patchSplinter Review
nsIDOMMouseScrollEvent was added in 1.9.1 (Bug 378028).
Attachment #395065 - Flags: review?(jst)
Status: NEW → ASSIGNED
Attachment #395065 - Flags: superreview+
Attachment #395065 - Flags: review?(jst)
Attachment #395065 - Flags: review+
http://hg.mozilla.org/mozilla-central/rev/d4e5fa9e2e91
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Do we want this on 1.9.2? If so, can we get a patch for approval?
Flags: wanted1.9.2+
Flags: blocking1.9.2?
Flags: blocking1.9.2-
Attachment #395065 - Flags: approval1.9.2?
Attachment #395065 - Flags: approval1.9.2? → approval1.9.2+
Updated:

https://developer.mozilla.org/en/Gecko-Specific_DOM_Events#DOMMouseScroll

Added:

https://developer.mozilla.org/en/nsIDOMMouseScrollEvent

This document was not previously written, but now has been, and includes a comment about the change in 1.9.2.
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.