Skip to content

Dom event handlers registration is broken. #3027

Closed
@DartBot

Description

@DartBot

This issue was originally filed by [email protected]


This issue has the same roots as http://code.google.com/p/dart/issues/detail?id=2937&q=event&colspec=ID%20Type%20Status%20Priority%20Area%20Milestone%20Owner%20Summary

It's easy to reproduce it.
We have html page:
<html>
<style type="text/css">
@-webkit-keyframes rotate {
  from {
    -webkit-transform: rotate(0deg);
  }
  to {
    -webkit-transform: rotate(360deg);
  }
}
</style>
<body>
<input type="text" id="button" value="button" />
</body>
</html>

And dart code:

import('dart:html')

void main() {
 Element elem = document.query('button');
 elem.$dom_addEventListener('webkitAnimationEnd', ([event]){ print('hack'); });
 elem.on['webkitAnimationEnd'].add(([event]){ print('suggested way'); });
 elem.style.cssText = '-webkit-animation: rotate 2s;';
}

The problem here is that the only 'hack' will be printed... 'on'-styled event binding is working only for a few simple events like 'click', 'focus', etc., but it's not enough...

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-duplicateClosed in favor of an existing report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions