05705dad2f
BUG= R=sigmund@google.com Review URL: https://codereview.chromium.org//24077003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27353 260f80e4-7a28-3924-810f-c04153c831b5
63 lines
1.7 KiB
HTML
63 lines
1.7 KiB
HTML
<!doctype html>
|
|
<!--
|
|
Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
|
for details. All rights reserved. Use of this source code is governed by a
|
|
BSD-style license that can be found in the LICENSE file.
|
|
-->
|
|
<html>
|
|
<head>
|
|
<title>event path</title>
|
|
<script src="packages/polymer/boot.js"></script>
|
|
<script src="packages/unittest/test_controller.js"></script>
|
|
<!--
|
|
Test ported from:
|
|
https://github.com/Polymer/polymer/blob/7936ff8/test/js/events.js
|
|
|
|
TODO(sigmund): when we have support for mutation observers, render all of
|
|
the test in Dart (like events.js does in JS)
|
|
-->
|
|
</head>
|
|
<body>
|
|
|
|
<polymer-element name="test-a" on-click="clickHandler">
|
|
<template></template>
|
|
<script type="application/dart">
|
|
import 'package:polymer/polymer.dart';
|
|
|
|
@CustomTag("test-a")
|
|
class TestA extends PolymerElement {
|
|
List clicks = [];
|
|
void clickHandler() {
|
|
clicks.add('host click on: $localName (id $id)');
|
|
}
|
|
}
|
|
</script>
|
|
</polymer-element>
|
|
|
|
<polymer-element name="test-b">
|
|
<template>
|
|
<div>
|
|
<span id="b-1">1</span>
|
|
<span id="b-2" on-click="clickHandler">2</span>
|
|
</div>
|
|
</template>
|
|
<script type="application/dart">
|
|
import 'package:polymer/polymer.dart';
|
|
|
|
@CustomTag("test-b")
|
|
class TestB extends PolymerElement {
|
|
List clicks = [];
|
|
void clickHandler(event, detail, target) {
|
|
clicks.add('local click under $localName (id $id) on ${target.id}');
|
|
}
|
|
}
|
|
</script>
|
|
</polymer-element>
|
|
|
|
<test-a id="a"></test-a>
|
|
<test-b id="b"></test-b>
|
|
|
|
<script type="application/dart" src="events_test.dart"></script>
|
|
</body>
|
|
</html>
|