I've posted the latest Signal iteration here:
http://trac.mochikit.com/ticket/27
I've made major changes to how DOM events are handled. Instead of
trying to normalize the native event object, Signal will return a
custom object with consistent property names and values between
Safari, Firefox, Win IE, and Opera.
Please review and test everything, this shouldn't be considered final
yet. The layerX and offsetX properties deserve a special mention
here. This seems to be a common idiom in other JavaScript libraries:
e.layerX = e.layerX || e.offsetX;
But I think this is incorrect. In NN/FF/Safari, the layerX/Y
properties refer to the cursor position relative to the event
target's positioning context. IE and Safari's offsetX/Y have always
referred to the cursor position relative to the event target (FF's
target == IE's srcElement) itself. I attached a simple HTML file
(layerX-vs-offsetX.html) to the ticket to demonstrate the difference.
Safari defines offsetX consistently with Opera and WinIE, and defines
layerX consistently with FF. Run the test document in Safari to see
that layerX and offsetX are not equivalent.
To get a consistent value across browsers, I recalculated layerX and
offsetX based on the cursor position, the target element's position,
and the target element's offsetLeft/offsetTop values. These values
seem to be consistent across browsers in all types of situations, but
I think this deserves some close attention from anyone thinking of
using Signal to do dynamic positioning.
I updated the documentation with lots of notes on the special object
we return. I also reverted to 'on' + event style names per Jonathan's
suggestion.
I added a test case to demonstrate an error when you try to fire a
signal in two separate objects. I haven't looked very hard at this
problem or a solution to it as I've been concentrating on DOM events.
I look forward to your comments!