OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 // DO NOT EDIT | 5 // DO NOT EDIT |
6 // Auto-generated dart:html library. | 6 // Auto-generated dart:html library. |
7 | 7 |
8 /// The Dart HTML library. | 8 /// The Dart HTML library. |
9 /// | 9 /// |
10 /// For examples, see | 10 /// For examples, see |
11 /// [Dart HTML5 Samples](https://github.com/dart-lang/dart-html5-samples) | 11 /// [Dart HTML5 Samples](https://github.com/dart-lang/dart-html5-samples) |
12 /// on Github. | 12 /// on Github. |
13 library dart.dom.html; | 13 library dart.dom.html; |
14 | 14 |
15 import 'dart:async'; | 15 import 'dart:async'; |
16 import 'dart:collection'; | 16 import 'dart:collection'; |
17 import 'dart:_collection-dev' hide Symbol, deprecated; | 17 import 'dart:_collection-dev' hide Symbol, deprecated; |
18 import 'dart:html_common'; | 18 import 'dart:html_common'; |
19 import 'dart:indexed_db'; | 19 import 'dart:indexed_db'; |
20 import 'dart:isolate'; | 20 import 'dart:isolate'; |
21 import 'dart:json' as json; | 21 import "dart:convert"; |
22 import 'dart:math'; | 22 import 'dart:math'; |
23 // TODO(vsm): Remove this when we can do the proper checking in | 23 // TODO(vsm): Remove this when we can do the proper checking in |
24 // native code for custom elements. | 24 // native code for custom elements. |
25 import 'dart:mirrors'; | 25 import 'dart:mirrors'; |
26 import 'dart:nativewrappers'; | 26 import 'dart:nativewrappers'; |
27 import 'dart:typed_data'; | 27 import 'dart:typed_data'; |
28 import 'dart:web_gl' as gl; | 28 import 'dart:web_gl' as gl; |
29 import 'dart:web_sql'; | 29 import 'dart:web_sql'; |
30 // Not actually used, but imported since dart:html can generate these objects. | 30 // Not actually used, but imported since dart:html can generate these objects. |
31 import 'dart:svg' as svg; | 31 import 'dart:svg' as svg; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 ElementList queryAll(String selector) => document.queryAll(selector); | 103 ElementList queryAll(String selector) => document.queryAll(selector); |
104 | 104 |
105 int _getNewIsolateId() => _Utils._getNewIsolateId(); | 105 int _getNewIsolateId() => _Utils._getNewIsolateId(); |
106 | 106 |
107 bool _callPortInitialized = false; | 107 bool _callPortInitialized = false; |
108 var _callPortLastResult = null; | 108 var _callPortLastResult = null; |
109 | 109 |
110 _callPortSync(num id, var message) { | 110 _callPortSync(num id, var message) { |
111 if (!_callPortInitialized) { | 111 if (!_callPortInitialized) { |
112 window.on['js-result'].listen((event) { | 112 window.on['js-result'].listen((event) { |
113 _callPortLastResult = json.parse(_getPortSyncEventData(event)); | 113 _callPortLastResult = JSON.decode(_getPortSyncEventData(event)); |
114 }); | 114 }); |
115 _callPortInitialized = true; | 115 _callPortInitialized = true; |
116 } | 116 } |
117 assert(_callPortLastResult == null); | 117 assert(_callPortLastResult == null); |
118 _dispatchEvent('js-sync-message', {'id': id, 'message': message}); | 118 _dispatchEvent('js-sync-message', {'id': id, 'message': message}); |
119 var result = _callPortLastResult; | 119 var result = _callPortLastResult; |
120 _callPortLastResult = null; | 120 _callPortLastResult = null; |
121 return result; | 121 return result; |
122 } | 122 } |
OLD | NEW |