Skip to content

Cannot register DOMSubtreeModified through "on" #2937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
peter-ahe-google opened this issue May 8, 2012 · 5 comments
Closed

Cannot register DOMSubtreeModified through "on" #2937

peter-ahe-google opened this issue May 8, 2012 · 5 comments
Assignees
Labels
closed-obsolete Closed as the reported issue is no longer relevant web-libraries Issues impacting dart:html, etc., libraries
Milestone

Comments

@peter-ahe-google
Copy link
Contributor

See the full program below. This works:

  div.$dom_addEventListener('DOMSubtreeModified', update);

This doesn't:

  div.on['DOMSubtreeModified'].add(update);

By "work" I mean that "got event" is not printed in the console.

<!DOCTYPE html>
<html>
  <head>
    <title>Bug</title>
  </head>
  <body>
    <script type="application/dart">

import('dart:html', prefix: 'html');

update(_) => print('got event');

main() {
  final div = html.document.query('#mydiv');
  // div.$dom_addEventListener('DOMSubtreeModified', update);
  div.on['DOMSubtreeModified'].add(update);
  div.nodes.add(new html.Element.html('<a href="index.html">home</a>'));
}
    </script>
    <div id="mydiv"></div>
  </body>
</html>

@DartBot
Copy link

DartBot commented May 12, 2012

This comment was originally written by [email protected]


Issue #3027 has been merged into this issue.

@vsmenon
Copy link
Member

vsmenon commented Jul 16, 2012

We may want to pull events in from dom/EventNames.h in WebCore or some other authoritative source.


Added this to the M1 milestone.

@iposva-google
Copy link
Contributor

Removed Area-DOM label.
Added Area-HTML label.

@blois
Copy link

blois commented Sep 4, 2012

Set owner to @blois.
Added Accepted label.

@blois
Copy link

blois commented Sep 5, 2012

This appears to be working correctly now, I've added a test to verify correctness though.

I did not explicitly add a subtreeModified event since the DOM mutation events have been deprecated in favor of DOM mutation observers. Using the on['DOMSubtreeModified'] syntax should work though.


Added AssumedStale label.

@peter-ahe-google peter-ahe-google added Type-Defect web-libraries Issues impacting dart:html, etc., libraries closed-obsolete Closed as the reported issue is no longer relevant labels Sep 5, 2012
@peter-ahe-google peter-ahe-google added this to the M1 milestone Sep 5, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-obsolete Closed as the reported issue is no longer relevant web-libraries Issues impacting dart:html, etc., libraries
Projects
None yet
Development

No branches or pull requests

5 participants