Closed
Bug 427537
Opened 17 years ago
Closed 14 years ago
Implement CustomEvent DOM3 specification
Categories
(Core :: DOM: Events, enhancement)
Core
DOM: Events
Tracking
()
RESOLVED
FIXED
mozilla6
People
(Reporter: a, Assigned: smaug)
References
()
Details
(Keywords: dev-doc-complete)
Attachments
(1 file)
14.27 KB,
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5 Build Identifier: CustomEvent is a DOM3 specification, and would make generated events a lot more powerful if implemented. We use js-generated events in XUL for TabOpen, TabClose etc. With current DOM API (createEvent/initEvent), you can't pass any arguments with the event. With CustomEvent API, an extra detail argument is allowed, making events a lot more useful. Trivial example, TabOpen could specify which tab got opened. Reproducible: Always Steps to Reproduce: 1. 2. 3.
Assignee | ||
Comment 1•17 years ago
|
||
DOM 3 Events is still just a *draft* and there will be changes for sure. (For example I'm going to propose to change CustomEvent interface a bit). On FF3 extension/chrome developers (well, also web developers could, but it isn't recommended) can use gecko-only nsIDOMDataContainerEvent. http://lxr.mozilla.org/seamonkey/source/dom/public/idl/events/nsIDOMDataContainerEvent.idl That is actually more flexible than CustomEvent, because it may contain any number any kind of data, identified using a string key. var evt = document.createEvent("datacontainerevents"); evt.initEvent("SomeEventName", true, true); evt.setData("key", "somevalue"); This bug is valid, but just shouldn't be fixed before DOM 3 Events is a bit more stable.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reporter | ||
Comment 2•17 years ago
|
||
Thanks for the tip about datacontainerevent. I wish I found about them earlier.
Updated•15 years ago
|
Blocks: ietestcenter
Updated•14 years ago
|
Version: unspecified → Trunk
Comment 3•14 years ago
|
||
I made a workaround for until this gets fixed: https://gist.github.com/961460
Assignee | ||
Updated•14 years ago
|
Assignee: nobody → Olli.Pettay
Assignee | ||
Comment 4•14 years ago
|
||
Attachment #531057 -
Flags: review?(jonas)
Attachment #531057 -
Flags: review?(jonas) → review+
Assignee | ||
Comment 5•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/47f42f84ba96 But I managed to mess up with the hg summary. Fortunately the bug number is there.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Keywords: dev-doc-needed
Target Milestone: --- → mozilla6
Keywords: dev-doc-needed → dev-doc-complete
Comment 6•13 years ago
|
||
trevorh, CustomEvent is an Event class, not a method called document.customEvent(). I've deleted all of your documentation and I'll try to document it myself (the new page is https://developer.mozilla.org/En/DOM/Event/CustomEvent), though I'm not that experienced with MDN page guidelines.
Comment 7•13 years ago
|
||
Ok I think it's good now.
You need to log in
before you can comment on or make changes to this bug.
Description
•