Closed
Bug 77251
Opened 25 years ago
Closed 25 years ago
document.createEvent() uses wrong event type strings
Categories
(Core :: DOM: Events, defect)
Core
DOM: Events
Tracking
()
VERIFIED
FIXED
mozilla0.9.1
People
(Reporter: david, Assigned: joki)
Details
(Keywords: dom2, Whiteboard: [fixinhand])
Attachments
(1 file)
|
2.00 KB,
patch
|
Details | Diff | Splinter Review |
document.createEvent() is currently implemented to work with singular event type
strings: "HTMLEvent", "MutationEvent", and so on.
This seems sensible, but the spec actually requires plural strings:
"MutationEvents", "HTMLEvents", and so on. The string passed to createEvent()
is the same one passed to document.implementation.hasFeature() to check whether
an event module is supported. See for example section 1.6.4 of the DOM Level 2
Eevent spec. It says:
"Note: To create an instance of the MutationEvent interface, use the feature
string 'MutationEvents' as the value of the input parameter used with the
createEvent method..."
Since this is likely to be a source of programmer confusion, my suggestion is to
make createEvent() work with both singular and plural strings.
[As an aside, note that createEvent() isn't working at all in Moz 0.8.1: when I
pass a correct plural string, it throws an exception. When I pass a singular
string it simply returns null! There seem to be other bugs pending about this.]
Updated•25 years ago
|
| Assignee | ||
Comment 1•25 years ago
|
||
Easy fix for 0.9.1
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.1
Comment 2•25 years ago
|
||
So, hyatt fixed the creation of MutationEvents in 75024, changing only the
string for MutationEvents to plural, but only for MutationEvents.
MouseEvent, KeyEvent, HTMLEvent and Event are still singular.
confusion goodness.
Adding both Heikki (reporter) and Hyatt (fixer (ugh, what a word)) from 75024.
Axel
| Assignee | ||
Comment 3•25 years ago
|
||
Comment 4•25 years ago
|
||
sr=hyatt
Comment 5•25 years ago
|
||
r=jst
Updated•25 years ago
|
Whiteboard: [fixinhand]
Comment 6•25 years ago
|
||
document.createEvent(pluralParameter)? Craziness. Anyone interested in
David's suggestion to support both? Ian, any idea about the logic behind this
naming?
| Assignee | ||
Comment 7•25 years ago
|
||
Fixed
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Comment 8•25 years ago
|
||
verifying on build 2001-05-04-04-trunk windows 98
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•