Bug 20361 - Should WebKit implement on* event handler properties for transition events?
Summary: Should WebKit implement on* event handler properties for transition events?
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 20571
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-12 10:46 PDT by Dean Jackson
Modified: 2008-09-01 17:15 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dean Jackson 2008-08-12 10:46:42 PDT
Currently the CSS Animation and Transition events are implemented using addEventListener and HTML attributes. Should we also add the .onwebkittransitionevent property on Element?
Comment 1 Timothy Hatcher 2008-08-12 10:50:36 PDT
One (cranky and sleepy) side of me says we should only support addEventListener for these events. Since I see the on* event attributes/properties as legacy. If we don't plan to add the properties we should remove the HTML attributes.

Or we should just support all three and let people use whatever they like, even if HTML attributes and string values assigned to event properties are less performant.
Comment 2 Anthony Ricaud 2008-08-12 11:19:19 PDT
I think this is important because every event is accessible through properties. And this way of doing events is sometime more useful. For example, it's easier to delete events handler.

It also seems strange to have HTML attributes without DOM properties.
Comment 3 Sam Weinig 2008-08-12 20:32:13 PDT
(In reply to comment #1)
> One (cranky and sleepy) side of me says we should only support addEventListener
> for these events. Since I see the on* event attributes/properties as legacy. If
> we don't plan to add the properties we should remove the HTML attributes.

What makes you feel that the attribute/property style event listeners is legacy.  Many new specs, including XMLHttpRequest Level 2, include new ones.(In reply to comment #2)

> I think this is important because every event is accessible through properties.
> And this way of doing events is sometime more useful. For example, it's easier
> to delete events handler.

Just to be clear though, it is not true that every event is accessible through properties, the "message" event used by postMessage doesn't for example.

That said, I do think attribute/property style event listeners should be added for consistency in the API.
Comment 4 Dean Jackson 2008-08-29 19:33:32 PDT
Turns out that this was mostly (but not quite) implemented.
See https://bugs.webkit.org/show_bug.cgi?id=20571

Comment 5 Dean Jackson 2008-09-01 17:15:02 PDT
Done now in blocking bug.