| 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 <head> | 8 <head> |
| 9 <title>event path</title> | 9 <title>event path</title> |
| 10 <script src="packages/polymer/testing/testing.js"></script> | 10 <script src="packages/polymer/testing/testing.js"></script> |
| 11 <script src="packages/unittest/test_controller.js"></script> | 11 <script src="packages/unittest/test_controller.js"></script> |
| 12 <!-- | 12 <!-- |
| 13 Test ported from: | 13 Test ported from: |
| 14 https://github.com/Polymer/polymer/blob/7936ff8/test/html/event-path.html | 14 https://github.com/Polymer/polymer/blob/7936ff8/test/html/event-path.html |
| 15 | 15 |
| 16 This test actually doesn't test the polymer's event layer. It just ensures | 16 This test actually doesn't test the polymer's event layer. It just ensures |
| 17 that tests are propagated in the right order when using Shadow DOM. | 17 that tests are propagated in the right order when using Shadow DOM. |
| 18 --> | 18 --> |
| 19 </head> | 19 </head> |
| 20 <body> | 20 <body> |
| 21 | 21 |
| 22 <polymer-element name="x-selector"> | 22 <polymer-element name="x-selector"> |
| 23 <template> | 23 <template> |
| 24 <div id="selectorDiv"> | 24 <div id="selectorDiv"> |
| 25 <content id="selectorContent"></content> | 25 <content id="selectorContent"></content> |
| 26 </div> | 26 </div> |
| 27 </template> | 27 </template> |
| 28 <script type="application/dart"> |
| 29 import 'package:polymer/polymer.dart'; |
| 30 @CustomTag("x-selector") |
| 31 class XSelector extends PolymerElement {} |
| 32 </script> |
| 28 </polymer-element> | 33 </polymer-element> |
| 29 | 34 |
| 30 <polymer-element name="x-overlay"> | 35 <polymer-element name="x-overlay"> |
| 31 <template> | 36 <template> |
| 32 <content id="overlayContent"></content> | 37 <content id="overlayContent"></content> |
| 33 </template> | 38 </template> |
| 39 <script type="application/dart"> |
| 40 import 'package:polymer/polymer.dart'; |
| 41 @CustomTag("x-overlay") |
| 42 class XOverlay extends PolymerElement {} |
| 43 </script> |
| 34 </polymer-element> | 44 </polymer-element> |
| 35 | 45 |
| 36 <polymer-element name="x-menu" extends="x-selector"> | 46 <polymer-element name="x-menu" extends="x-selector"> |
| 37 <template> | 47 <template> |
| 38 <div id="menuDiv"> | 48 <div id="menuDiv"> |
| 39 <shadow id="menuShadow"></shadow> | 49 <shadow id="menuShadow"></shadow> |
| 40 </div> | 50 </div> |
| 41 </template> | 51 </template> |
| 52 <script type="application/dart"> |
| 53 import 'package:polymer/polymer.dart'; |
| 54 @CustomTag("x-menu") |
| 55 class XMenu extends PolymerElement {} |
| 56 </script> |
| 42 </polymer-element> | 57 </polymer-element> |
| 43 | 58 |
| 44 <polymer-element name="x-menu-button"> | 59 <polymer-element name="x-menu-button"> |
| 45 <template> | 60 <template> |
| 46 <div> | 61 <div> |
| 47 <x-overlay id="overlay"> | 62 <x-overlay id="overlay"> |
| 48 <div id="menuButtonDiv"> | 63 <div id="menuButtonDiv"> |
| 49 <x-menu id="menu"> | 64 <x-menu id="menu"> |
| 50 <content id="menuButtonContent"></content> | 65 <content id="menuButtonContent"></content> |
| 51 </x-menu> | 66 </x-menu> |
| 52 </div> | 67 </div> |
| 53 </x-overlay> | 68 </x-overlay> |
| 54 </div> | 69 </div> |
| 55 </template> | 70 </template> |
| 71 <script type="application/dart"> |
| 72 import 'package:polymer/polymer.dart'; |
| 73 @CustomTag("x-menu-button") |
| 74 class XMenuButton extends PolymerElement {} |
| 75 </script> |
| 56 </polymer-element> | 76 </polymer-element> |
| 57 | 77 |
| 58 <x-menu-button id="menuButton"> | 78 <x-menu-button id="menuButton"> |
| 59 <div id="item1"><div id="source"></div>Item1</div> | 79 <div id="item1"><div id="source"></div>Item1</div> |
| 60 <div id="item2">Item2</div> | 80 <div id="item2">Item2</div> |
| 61 </x-menu-button> | 81 </x-menu-button> |
| 62 | 82 |
| 63 | 83 |
| 64 <script type="application/dart"> | 84 <script type="application/dart"> |
| 65 import 'dart:html'; | 85 import 'dart:html'; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 })); | 133 })); |
| 114 } | 134 } |
| 115 | 135 |
| 116 item1.dispatchEvent(new Event('x', canBubble: true)); | 136 item1.dispatchEvent(new Event('x', canBubble: true)); |
| 117 })); | 137 })); |
| 118 }); | 138 }); |
| 119 } | 139 } |
| 120 </script> | 140 </script> |
| 121 </body> | 141 </body> |
| 122 </html> | 142 </html> |
| OLD | NEW |