Bug 20361
| Summary: | Should WebKit implement on* event handler properties for transition events? | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Dean Jackson <dino> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | dino, hyatt, rik, simon.fraser |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Mac | ||
| OS: | OS X 10.5 | ||
| Bug Depends on: | 20571 | ||
| Bug Blocks: | |||
Dean Jackson
Currently the CSS Animation and Transition events are implemented using addEventListener and HTML attributes. Should we also add the .onwebkittransitionevent property on Element?
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Timothy Hatcher
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.
Anthony Ricaud
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.
Sam Weinig
(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.
Dean Jackson
Turns out that this was mostly (but not quite) implemented.
See https://bugs.webkit.org/show_bug.cgi?id=20571
Dean Jackson
Done now in blocking bug.