PeerConnection.js: TypeError: Argument 2 of EventTarget.setEventHandler is not callable.

RESOLVED FIXED in Firefox 42

Status

()

defect
P3
minor
Rank:
35
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: jruderman, Assigned: bzbarsky)

Tracking

(Blocks 1 bug, {testcase})

Trunk
mozilla42
Points:
---

Firefox Tracking Flags

(firefox42 fixed)

Details

Attachments

(2 attachments)

(Reporter)

Description

4 years ago
Posted file testcase
JavaScript error: resource://gre/components/PeerConnection.js, line 610: TypeError: Argument 2 of EventTarget.setEventHandler is not callable.
Right, so every EventHandler attribute must swallow object (TreatNonObjectAsNull) because some Dell website did something silly in 2013? [1]

If so, then we have more bugs to file:
onprogress [2]
oncontactchange [3]
ondownloadstart [4]
onstatechange [5]
onmessage [6]
...

[1] https://lists.w3.org/Archives/Public/public-script-coord/2013OctDec/0412.html
[2] http://mxr.mozilla.org/mozilla-central/source/dom/apps/Webapps.js?rev=932a80206f57#499
[3] http://mxr.mozilla.org/mozilla-central/source/dom/contacts/ContactManager.js?rev=66f5705f110d#84
[4] http://mxr.mozilla.org/mozilla-central/source/dom/downloads/DownloadsAPI.js?rev=4d0ef24554ca#65
[5] http://mxr.mozilla.org/mozilla-central/source/dom/downloads/DownloadsAPI.js?rev=4d0ef24554ca#311
[6] http://mxr.mozilla.org/mozilla-central/source/dom/engineeringmode/EngineeringModeAPI.js#87

OK I only got to 'e' in the alphabet, but there are more, and these are only the JSImplemented ones, so you get the idea: there are a lot of these, and they all presumably have the same problem.

Bz, what's the answer here?

A) Change all of these to:

   typeof handler == "function" && this.__DOM_IMPL__.setEventHandler("onfoo", handler);

B) Make some new NonDellEventHandler that throws or is TreatNonCallableAsNull? 

C) Something else?
Flags: needinfo?(bzbarsky)
backlog: --- → webRTC+
Rank: 35
Priority: -- → P3
> because some Dell website did something silly in 2013?

Welcome to the web.  Note that I would be surprised if the Dell site were the only one doing that sort of thing....

The right answer here is to change our setEventHandler thing to deal.
Flags: needinfo?(bzbarsky)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Comment on attachment 8637743 [details] [diff] [review]
Event handlers on JS-implemented webidl interfaces should have the same behavior as other event handlers: accept all values, convert non-objects to null

r+ I guess. allowTreatNonCallableAsNull handling is a bit hard to follow.
Attachment #8637743 - Flags: review?(bugs) → review+
Yeah, once we move Promise off webidl we should clean it up a bit...
https://hg.mozilla.org/mozilla-central/rev/6327a01d4687
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
You need to log in before you can comment on or make changes to this bug.