Skip to content

event.target fails in click handler on body #2088

Closed
@sethladd

Description

@sethladd

Clicking on the body will print the right output, but clicking on the bold, small, or paragraph will generate this error:

FIXME:1Exception: Unrecognized object Instance of 'HTMLElementImplementation'. Name=HTMLElement
Stack Trace: 0. Function: '::_wrap@33cc944a' url: 'dart:html' line:568 col:7
 1. Function: '_EventImpl@33cc944a.get:target' url: 'dart:html' line:8071 col:62
 2. Function: '::function' url: 'file:///Users/sethladd/dart/bodyonclick/bodyonclick.dart' line:5 col:23
 3. Function: '_EventListenerListImpl@33cc944a.function' url: 'dart:html' line:8263 col:35

The HTML code:

<html>
  <head>
    <title>bodyonclick</title>
  </head>
  <body>
    <b>bold</b>
    <small>small</small>
    <p>paragraph</p>
    <script type="application/dart" src="bodyonclick.dart"></script>
    <script src="http://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js&quot;&gt;&lt;/script>
  </body>
</html>

The Dart code:

import('dart:html');

    
void main() {
  document.body.on.click.add((event) {
    print(event.target);
  });
}

Contents from about:version:

Chromium 19.0.1050.0 (Developer Build 123195)
OS Mac OS X
WebKit 535.22 (Source/WebCore/Configurations@221)
JavaScript V8 3.9.8
DartVM r5005
Flash 11.1.102.62
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.22 (KHTML, like Gecko) Chrome/19.0.1050.0 (Dart) Safari/535.22
Command Line /Users/sethladd/Downloads/dart/dart-sdk/Chromium.app/Contents/MacOS/Chromium --remote-debugging-port=9222 --user-data-dir=/Users/sethladd/.dartChromeSettings --bwsi --no-first-run --no-default-browser-check --no-process-singleton-dialog --flag-switches-begin --flag-switches-end file:/Users/sethladd/dart/bodyonclick/bodyonclick.html
Executable Path /Users/sethladd/Downloads/dart/dart-sdk/Chromium.app/Contents/MacOS/Chromium
Profile Path /Users/sethladd/.dartChromeSettings/Default

Metadata

Metadata

Assignees

Labels

closed-obsoleteClosed as the reported issue is no longer relevant

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions