| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 3 Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 4 for details. All rights reserved. Use of this source code is governed by a | 4 for details. All rights reserved. Use of this source code is governed by a |
| 5 BSD-style license that can be found in the LICENSE file. | 5 BSD-style license that can be found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 <html> | 7 <html> |
| 8 <!--polymer-test: this comment is needed for test_suite.dart--> | 8 <!--polymer-test: this comment is needed for test_suite.dart--> |
| 9 <head> | 9 <head> |
| 10 <title>event path</title> | 10 <title>event path</title> |
| 11 <script src="packages/web_components/platform.js"></script> |
| 12 <script src="packages/web_components/dart_support.js"></script> |
| 11 <link rel="import" href="packages/polymer/polymer.html"> | 13 <link rel="import" href="packages/polymer/polymer.html"> |
| 12 <script src="/root_dart/tools/testing/dart/test_controller.js"></script> | 14 <script src="/root_dart/tools/testing/dart/test_controller.js"></script> |
| 13 </head> | 15 </head> |
| 14 <body> | 16 <body> |
| 15 | 17 |
| 16 <polymer-element name="x-test"> | 18 <polymer-element name="x-test"> |
| 17 <template> | 19 <template> |
| 18 <div id="a" on-my-event={{myEventHandler}}></div> | 20 <div id="a" on-my-event={{myEventHandler}}></div> |
| 19 </template> | 21 </template> |
| 20 </polymer-element> | 22 </polymer-element> |
| 21 <x-test></x-test> | 23 <x-test></x-test> |
| 22 <script> | 24 <script> |
| 23 function fireEvent() { | 25 function fireEvent() { |
| 24 var x = document.querySelector('x-test'); | 26 var x = document.querySelector('x-test'); |
| 25 var a = x.shadowRoot.querySelector('#a'); | 27 var a = x.shadowRoot.querySelector('#a'); |
| 26 var e = new CustomEvent('my-event', { | 28 var e = new CustomEvent('my-event', { |
| 27 bubbles: true, | 29 bubbles: true, |
| 28 cancelable: true, | 30 cancelable: true, |
| 29 // `a` included as a regression for issue 19315. | 31 // `a` included as a regression for issue 19315. |
| 30 detail: {value: 42, item: a} | 32 detail: {value: 42, item: a} |
| 31 }); | 33 }); |
| 32 a.dispatchEvent(e); | 34 a.dispatchEvent(e); |
| 33 } | 35 } |
| 34 </script> | 36 </script> |
| 35 <script type="application/dart" src="js_custom_event_test.dart"></script> | 37 <script type="application/dart" src="js_custom_event_test.dart"></script> |
| 36 </body> | 38 </body> |
| 37 </html> | 39 </html> |
| OLD | NEW |