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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 ElementList queryAll(String selector) => document.queryAll(selector); | 106 ElementList queryAll(String selector) => document.queryAll(selector); |
107 | 107 |
108 int _getNewIsolateId() => _Utils._getNewIsolateId(); | 108 int _getNewIsolateId() => _Utils._getNewIsolateId(); |
109 | 109 |
110 bool _callPortInitialized = false; | 110 bool _callPortInitialized = false; |
111 var _callPortLastResult = null; | 111 var _callPortLastResult = null; |
112 | 112 |
113 _callPortSync(num id, var message) { | 113 _callPortSync(num id, var message) { |
114 if (!_callPortInitialized) { | 114 if (!_callPortInitialized) { |
115 window.on['js-result'].listen((event) { | 115 window.on['js-result'].listen((event) { |
116 _callPortLastResult = json.parse(_getPortSyncEventData(event)); | 116 _callPortLastResult = JSON.decode(_getPortSyncEventData(event)); |
117 }); | 117 }); |
118 _callPortInitialized = true; | 118 _callPortInitialized = true; |
119 } | 119 } |
120 assert(_callPortLastResult == null); | 120 assert(_callPortLastResult == null); |
121 _dispatchEvent('js-sync-message', {'id': id, 'message': message}); | 121 _dispatchEvent('js-sync-message', {'id': id, 'message': message}); |
122 var result = _callPortLastResult; | 122 var result = _callPortLastResult; |
123 _callPortLastResult = null; | 123 _callPortLastResult = null; |
124 return result; | 124 return result; |
125 } | 125 } |
OLD | NEW |