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 <script type='application/javascript' src="testing.js"></script> | 9 <script type='application/javascript' src="testing.js"></script> |
10 <style> div { padding: 10px; } </style> | 10 <style> div { padding: 10px; } </style> |
11 </head> | 11 </head> |
12 <body> | 12 <body> |
13 Expect nested divs 0 then 1. | 13 Expect nested divs 0 then 1. |
14 <element name='x-rec' extends="div"> | 14 <element name='x-rec' extends="div"> |
15 <template> | 15 <template> |
16 {{check(pos)}} | 16 {{check(pos)}} |
17 <template if="pos < len"> | 17 <template if="pos < len"> |
18 <div is="x-rec" pos="{{pos + 1}}"></div> | 18 <div is="x-rec" pos="{{pos + 1}}"></div> |
19 </template> | 19 </template> |
20 </template> | 20 </template> |
21 <script type='application/dart'> | 21 <script type='application/dart'> |
22 import 'package:web_ui/web_ui.dart'; | 22 import 'package:web_ui/web_ui.dart'; |
23 import 'recursive_test_data.dart'; | 23 import 'recursive_test_data.dart'; |
24 @observable | |
Siggi Cherem (dart-lang)
2013/02/13 19:28:54
as soon as we switch, would we want to make all su
Jennifer Messerly
2013/02/14 00:38:09
It's a good question. I'm not sure, because it add
| |
24 class Rec extends WebComponent { | 25 class Rec extends WebComponent { |
25 int pos; | 26 int pos; |
26 } | 27 } |
27 </script> | 28 </script> |
28 </element> | 29 </element> |
29 <div is="x-rec" pos="{{0}}"></div> | 30 <div is="x-rec" pos="{{0}}"></div> |
30 | 31 |
31 <script type="application/dart"> | 32 <script type="application/dart"> |
32 import 'dart:html'; | 33 import 'dart:html'; |
33 import 'package:web_ui/watcher.dart'; | 34 import 'package:web_ui/observe.dart'; |
34 import 'recursive_test_data.dart'; | 35 import 'recursive_test_data.dart'; |
35 | 36 |
36 main() { | 37 main() { |
37 window.setTimeout(() { | 38 window.setTimeout(() { |
38 dispatch(); | 39 deliverChangesSync(); |
39 window.setTimeout(() { | 40 window.setTimeout(() { |
40 len = 1; | 41 len = 1; |
41 dispatch(); | 42 deliverChangesSync(); |
42 window.setTimeout(() { | 43 window.setTimeout(() { |
43 len = 3; | 44 len = 3; |
44 dispatch(); | 45 deliverChangesSync(); |
45 window.setTimeout(() { | 46 window.setTimeout(() { |
46 len = 2; | 47 len = 2; |
47 dispatch(); | 48 deliverChangesSync(); |
48 window.setTimeout(() { | 49 window.setTimeout(() { |
49 len = 1; | 50 len = 1; |
50 dispatch(); | 51 deliverChangesSync(); |
51 window.setTimeout(() => window.postMessage('done', '*'), 0); | 52 window.setImmediate(() => window.postMessage('done', '*')); |
52 }, 0); | 53 }, 0); |
53 }, 0); | 54 }, 0); |
54 }, 0); | 55 }, 0); |
55 }, 0); | 56 }, 0); |
56 }, 0); | 57 }, 0); |
57 } | 58 } |
58 </script> | 59 </script> |
59 </body> | 60 </body> |
60 </html> | 61 </html> |
61 | 62 |
OLD | NEW |