Description
Current Situation
Currently attributes of the event target are simply assigned to the top-level of the event object. In retrospect this was a mistake because there are different kinds of targets (e.g. currentTarget
and relatedTarget
) in addition to the possibility of conflicts with the event's own attributes.
Proposed Changes
Create new keys in event information for "currentTarget"
, and "relatedTarget"
where target element attributes will be stored. In addition event information for target
will be moved under a new "target"
key.
Implementation Details
Since attributes of target
are currently available at the top-level of the event dictionary, to avoid an immediate backwards incompatible change, we will create an EventProxy
object that wraps the original event data and aliases any missing keys to event['target'][key]
. When the EventProxy
object needs to alias a key in this way, it will produce a warning that attributes of target
have been moved to the "target"
key.