Skip to content

Cannot register DOMSubtreeModified through "on" #2937

Closed
@peter-ahe-google

Description

@peter-ahe-google

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>

Activity

DartBot

DartBot commented on May 12, 2012

@DartBot

This comment was originally written by antonm@google.com


Issue #3027 has been merged into this issue.

vsmenon

vsmenon commented on Jul 16, 2012

@vsmenon
Member

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

iposva-google commented on Aug 13, 2012

@iposva-google
Contributor

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

blois

blois commented on Sep 4, 2012

@blois

Set owner to @blois.
Added Accepted label.

blois

blois commented on Sep 5, 2012

@blois

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.

added this to the M1 milestone on Sep 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

closed-obsoleteClosed as the reported issue is no longer relevantweb-librariesIssues impacting dart:html, etc., libraries

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @vsmenon@blois@iposva-google@peter-ahe-google@DartBot

      Issue actions

        Cannot register DOMSubtreeModified through "on" · Issue #2937 · dart-lang/sdk