| OLD | NEW |
| 1 /// The Dart HTML library. | 1 /// The Dart HTML library. |
| 2 library dart.dom.html; | 2 library dart.dom.html; |
| 3 | 3 |
| 4 import 'dart:async'; | 4 import 'dart:async'; |
| 5 import 'dart:collection'; | 5 import 'dart:collection'; |
| 6 import 'dart:_collection-dev' hide Symbol; | 6 import 'dart:_collection-dev' hide Symbol; |
| 7 import 'dart:html_common'; | 7 import 'dart:html_common'; |
| 8 import 'dart:indexed_db'; | 8 import 'dart:indexed_db'; |
| 9 import 'dart:isolate'; | 9 import 'dart:isolate'; |
| 10 import 'dart:json' as json; | 10 import 'dart:json' as json; |
| (...skipping 22904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 22915 * port may be retrieved by any isolate (or JavaScript script) | 22915 * port may be retrieved by any isolate (or JavaScript script) |
| 22916 * running in this window. | 22916 * running in this window. |
| 22917 */ | 22917 */ |
| 22918 void registerPort(String name, var port) { | 22918 void registerPort(String name, var port) { |
| 22919 var serialized = _serialize(port); | 22919 var serialized = _serialize(port); |
| 22920 document.documentElement.attributes['dart-port:$name'] = | 22920 document.documentElement.attributes['dart-port:$name'] = |
| 22921 json.stringify(serialized); | 22921 json.stringify(serialized); |
| 22922 } | 22922 } |
| 22923 | 22923 |
| 22924 /** | 22924 /** |
| 22925 * Returns a Future that completes just before the window is about to repaint | 22925 * Returns a Future that completes just before the window is about to |
| 22926 * so the user can draw an animation frame | 22926 * repaint so the user can draw an animation frame. |
| 22927 * | 22927 * |
| 22928 * If you need to later cancel this animation, use [requestAnimationFrame] | 22928 * If you need to later cancel this animation, use [requestAnimationFrame] |
| 22929 * instead. | 22929 * instead. |
| 22930 * | 22930 * |
| 22931 * The [Future] completes to a timestamp that represents a floating |
| 22932 * point value of the number of milliseconds that have elapsed since the page |
| 22933 * started to load (which is also the timestamp at this call to |
| 22934 * animationFrame). |
| 22935 * |
| 22931 * Note: The code that runs when the future completes should call | 22936 * Note: The code that runs when the future completes should call |
| 22932 * [animationFrame] again for the animation to continue. | 22937 * [animationFrame] again for the animation to continue. |
| 22933 */ | 22938 */ |
| 22934 Future<num> get animationFrame { | 22939 Future<num> get animationFrame { |
| 22935 var completer = new Completer<num>(); | 22940 var completer = new Completer<num>(); |
| 22936 requestAnimationFrame((time) { | 22941 requestAnimationFrame((time) { |
| 22937 completer.complete(time); | 22942 completer.complete(time); |
| 22938 }); | 22943 }); |
| 22939 return completer.future; | 22944 return completer.future; |
| 22940 } | 22945 } |
| (...skipping 6919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 29860 _position = nextPosition; | 29865 _position = nextPosition; |
| 29861 return true; | 29866 return true; |
| 29862 } | 29867 } |
| 29863 _current = null; | 29868 _current = null; |
| 29864 _position = _array.length; | 29869 _position = _array.length; |
| 29865 return false; | 29870 return false; |
| 29866 } | 29871 } |
| 29867 | 29872 |
| 29868 T get current => _current; | 29873 T get current => _current; |
| 29869 } | 29874 } |
| OLD | NEW |