| OLD | NEW |
| 1 <!doctype html> | 1 <!doctype html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 Copyright (c) 2012, 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 lang="en"> | 7 <html lang="en"> |
| 8 <head> | 8 <head> |
| 9 <meta charset="utf-8"> | 9 <meta charset="utf-8"> |
| 10 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 10 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| 11 <script type="application/javascript" src="testing.js"></script> | 11 <script type="application/javascript" src="testing.js"></script> |
| 12 </head> | 12 </head> |
| 13 <body> | 13 <body> |
| 14 <element name="x-base" extends="div" constructor="Base"> | 14 <element name="x-base" extends="div" constructor="Base"> |
| 15 <template> | 15 <template> |
| 16 <div>Here are the lifecycle methods that have been called:</div> | 16 <div>Here are the lifecycle methods that have been called:</div> |
| 17 <pre>{{status}}</pre> | 17 <pre>{{status}}</pre> |
| 18 <div>You should see Base created, Derived created, | 18 <div>You should see Base created, Derived created, |
| 19 Base inserted, Derived inserted</div> | 19 Base inserted, Derived inserted</div> |
| 20 </template> | 20 </template> |
| 21 <script type="application/dart"> | 21 <script type="application/dart"> |
| 22 import 'package:web_components/web_components.dart'; | 22 import 'package:web_ui/web_ui.dart'; |
| 23 class Base extends WebComponent { | 23 class Base extends WebComponent { |
| 24 String status = ''; | 24 String status = ''; |
| 25 created() { | 25 created() { |
| 26 status = '${status}\nBase.created'; | 26 status = '${status}\nBase.created'; |
| 27 } | 27 } |
| 28 inserted() { | 28 inserted() { |
| 29 status = '${status}\nBase.inserted'; | 29 status = '${status}\nBase.inserted'; |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 </script> | 32 </script> |
| 33 </element> | 33 </element> |
| 34 <element name="x-derived" extends="x-base" constructor="Derived"> | 34 <element name="x-derived" extends="x-base" constructor="Derived"> |
| 35 <template><shadow></shadow></template> | 35 <template><shadow></shadow></template> |
| 36 <script type="application/dart"> | 36 <script type="application/dart"> |
| 37 import 'package:web_components/web_components.dart'; | 37 import 'package:web_ui/web_ui.dart'; |
| 38 | 38 |
| 39 class Derived extends Base { | 39 class Derived extends Base { |
| 40 created() { | 40 created() { |
| 41 super.created(); | 41 super.created(); |
| 42 status = '${status}\nDerived.created'; | 42 status = '${status}\nDerived.created'; |
| 43 } | 43 } |
| 44 inserted() { | 44 inserted() { |
| 45 super.inserted(); | 45 super.inserted(); |
| 46 status = '${status}\nDerived.inserted'; | 46 status = '${status}\nDerived.inserted'; |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 </script> | 49 </script> |
| 50 </element> | 50 </element> |
| 51 <div is="x-derived"></div> | 51 <div is="x-derived"></div> |
| 52 <script type="application/dart"> | 52 <script type="application/dart"> |
| 53 import 'common.dart'; | 53 import 'common.dart'; |
| 54 import 'dart:html'; | 54 import 'dart:html'; |
| 55 main() { | 55 main() { |
| 56 window.setTimeout(() => window.postMessage('done', '*'), 0); | 56 window.setTimeout(() => window.postMessage('done', '*'), 0); |
| 57 } | 57 } |
| 58 </script> | 58 </script> |
| 59 </body> | 59 </body> |
| 60 </html> | 60 </html> |
| OLD | NEW |