| 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 /** | 8 /** |
| 9 * HTML elements and other resources for web-based applications that need to | 9 * HTML elements and other resources for web-based applications that need to |
| 10 * interact with the browser and the DOM (Document Object Model). | 10 * interact with the browser and the DOM (Document Object Model). |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 * This isolate is not concurrent. It runs on the browser thread | 144 * This isolate is not concurrent. It runs on the browser thread |
| 145 * with full access to the DOM. | 145 * with full access to the DOM. |
| 146 * Note: this API is still evolving and may move to dart:isolate. | 146 * Note: this API is still evolving and may move to dart:isolate. |
| 147 */ | 147 */ |
| 148 @Experimental() | 148 @Experimental() |
| 149 Future<Isolate> spawnDomUri(Uri uri, List<String> args, message) { | 149 Future<Isolate> spawnDomUri(Uri uri, List<String> args, message) { |
| 150 // TODO(17738): Plumb arguments and return value through. | 150 // TODO(17738): Plumb arguments and return value through. |
| 151 return _Utils.spawnDomUri(uri.toString()); | 151 return _Utils.spawnDomUri(uri.toString()); |
| 152 } | 152 } |
| 153 // FIXME: Can we make this private? | 153 // FIXME: Can we make this private? |
| 154 @Deprecated("Internal Use Only") |
| 154 final htmlBlinkMap = { | 155 final htmlBlinkMap = { |
| 155 '_HistoryCrossFrame': () => _HistoryCrossFrame, | 156 '_HistoryCrossFrame': () => _HistoryCrossFrame, |
| 156 '_LocationCrossFrame': () => _LocationCrossFrame, | 157 '_LocationCrossFrame': () => _LocationCrossFrame, |
| 157 '_DOMWindowCrossFrame': () => _DOMWindowCrossFrame, | 158 '_DOMWindowCrossFrame': () => _DOMWindowCrossFrame, |
| 158 // FIXME: Move these to better locations. | 159 // FIXME: Move these to better locations. |
| 159 'DateTime': () => DateTime, | 160 'DateTime': () => DateTime, |
| 160 'JsObject': () => js.JsObjectImpl, | 161 'JsObject': () => js.JsObjectImpl, |
| 161 'JsFunction': () => js.JsFunctionImpl, | 162 'JsFunction': () => js.JsFunctionImpl, |
| 162 'JsArray': () => js.JsArrayImpl, | 163 'JsArray': () => js.JsArrayImpl, |
| 163 $!TYPE_MAP | 164 $!TYPE_MAP |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 } | 253 } |
| 253 | 254 |
| 254 $if JSINTEROP | 255 $if JSINTEROP |
| 255 // FIXME: Can we make this private? | 256 // FIXME: Can we make this private? |
| 256 final htmlBlinkFunctionMap = { | 257 final htmlBlinkFunctionMap = { |
| 257 $!TYPE_FUNCTION_MAP | 258 $!TYPE_FUNCTION_MAP |
| 258 }; | 259 }; |
| 259 | 260 |
| 260 // TODO(terry): We may want to move this elsewhere if html becomes | 261 // TODO(terry): We may want to move this elsewhere if html becomes |
| 261 // a package to avoid dartium depending on pkg:html. | 262 // a package to avoid dartium depending on pkg:html. |
| 263 @Deprecated("Internal Use Only") |
| 262 getHtmlCreateFunction(String key) { | 264 getHtmlCreateFunction(String key) { |
| 263 var result; | 265 var result; |
| 264 | 266 |
| 265 // TODO(vsm): Add Cross Frame and JS types here as well. | 267 // TODO(vsm): Add Cross Frame and JS types here as well. |
| 266 | 268 |
| 267 // Check the html library. | 269 // Check the html library. |
| 268 result = _getHtmlFunction(key); | 270 result = _getHtmlFunction(key); |
| 269 if (result != null) { | 271 if (result != null) { |
| 270 return result; | 272 return result; |
| 271 } | 273 } |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 } | 386 } |
| 385 } else { | 387 } else { |
| 386 throw new UnsupportedError('Element is incorrect type. Got ${runtimeType}, e
xpected HtmlElement/HtmlTemplate/JsObjectImpl.'); | 388 throw new UnsupportedError('Element is incorrect type. Got ${runtimeType}, e
xpected HtmlElement/HtmlTemplate/JsObjectImpl.'); |
| 387 } | 389 } |
| 388 | 390 |
| 389 return tag; | 391 return tag; |
| 390 } | 392 } |
| 391 | 393 |
| 392 /// An abstract class for all DOM objects we wrap in dart:html and related | 394 /// An abstract class for all DOM objects we wrap in dart:html and related |
| 393 /// libraries. | 395 /// libraries. |
| 396 /// |
| 397 /// ** Internal Use Only ** |
| 398 @Deprecated("Internal Use Only") |
| 394 class DartHtmlDomObject { | 399 class DartHtmlDomObject { |
| 395 | 400 |
| 396 /// The underlying JS DOM object. | 401 /// The underlying JS DOM object. |
| 402 @Deprecated("Internal Use Only") |
| 397 js.JsObject blink_jsObject; | 403 js.JsObject blink_jsObject; |
| 398 | 404 |
| 399 } | 405 } |
| 400 | 406 |
| 401 /// Upgrade a Dart HtmlElement to the user's Dart custom element class. | 407 /// Upgrade a Dart HtmlElement to the user's Dart custom element class. |
| 402 _upgradeHtmlElement(dartInstance) { | 408 _upgradeHtmlElement(dartInstance) { |
| 403 // Only try upgrading HtmlElement (Dart class) if there is a failure then | 409 // Only try upgrading HtmlElement (Dart class) if there is a failure then |
| 404 // don't try it again - one failure is enough. | 410 // don't try it again - one failure is enough. |
| 405 if (dartInstance.runtimeType == HtmlElement && !dartInstance.isBadUpgrade) { | 411 if (dartInstance.runtimeType == HtmlElement && !dartInstance.isBadUpgrade) { |
| 406 // Must be exactly HtmlElement not something derived from it. | 412 // Must be exactly HtmlElement not something derived from it. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 417 } finally { | 423 } finally { |
| 418 dartInstance.blink_jsObject = jsObject; | 424 dartInstance.blink_jsObject = jsObject; |
| 419 js.setDartHtmlWrapperFor(jsObject, dartInstance); | 425 js.setDartHtmlWrapperFor(jsObject, dartInstance); |
| 420 } | 426 } |
| 421 } | 427 } |
| 422 } | 428 } |
| 423 | 429 |
| 424 return dartInstance; | 430 return dartInstance; |
| 425 } | 431 } |
| 426 | 432 |
| 433 @Deprecated("Internal Use Only") |
| 427 class DebugAssertException implements Exception { | 434 class DebugAssertException implements Exception { |
| 428 String message; | 435 String message; |
| 429 DebugAssertException(this.message); | 436 DebugAssertException(this.message); |
| 430 } | 437 } |
| 431 | 438 |
| 439 @Deprecated("Internal Use Only") |
| 432 debug_or_assert(message, expression) { | 440 debug_or_assert(message, expression) { |
| 433 if (!expression) { | 441 if (!expression) { |
| 434 throw new DebugAssertException("$message"); | 442 throw new DebugAssertException("$message"); |
| 435 } | 443 } |
| 436 } | 444 } |
| 437 | 445 |
| 438 // TODO(terry): Manage JS interop JsFunctions for each listener used for add/ | 446 // TODO(terry): Manage JS interop JsFunctions for each listener used for add/ |
| 439 // removeEventListener. These JsFunctions will leak look at | 447 // removeEventListener. These JsFunctions will leak look at |
| 440 // fixing with weak-refs in C++. The key are the hashcodes of the | 448 // fixing with weak-refs in C++. The key are the hashcodes of the |
| 441 // user's this (this is needed for futures) and listener function. | 449 // user's this (this is needed for futures) and listener function. |
| 442 Map<int, Map<int, js.JsFunction>> _knownListeners = {}; | 450 Map<int, Map<int, js.JsFunction>> _knownListeners = {}; |
| 443 | 451 |
| 452 @Deprecated("Internal Use Only") |
| 444 js.JsFunction wrap_event_listener(theObject, Function listener) { | 453 js.JsFunction wrap_event_listener(theObject, Function listener) { |
| 445 var thisHashCode = theObject.hashCode; | 454 var thisHashCode = theObject.hashCode; |
| 446 var listenerHashCode = identityHashCode(listener); | 455 var listenerHashCode = identityHashCode(listener); |
| 447 | 456 |
| 448 _knownListeners.putIfAbsent(thisHashCode, () => new Map<int, js.JsFunction>())
; | 457 _knownListeners.putIfAbsent(thisHashCode, () => new Map<int, js.JsFunction>())
; |
| 449 _knownListeners[thisHashCode].putIfAbsent(listenerHashCode, () => | 458 _knownListeners[thisHashCode].putIfAbsent(listenerHashCode, () => |
| 450 new js.JsFunction.withThis((theObject, event) => listener(wrap_jso(event))))
; | 459 new js.JsFunction.withThis((theObject, event) => listener(wrap_jso(event))))
; |
| 451 | 460 |
| 452 return _knownListeners[thisHashCode][listenerHashCode]; | 461 return _knownListeners[thisHashCode][listenerHashCode]; |
| 453 } | 462 } |
| 454 | 463 |
| 464 @Deprecated("Internal Use Only") |
| 455 Map<String, dynamic> convertNativeObjectToDartMap(js.JsObject jsObject) { | 465 Map<String, dynamic> convertNativeObjectToDartMap(js.JsObject jsObject) { |
| 456 var result = new Map(); | 466 var result = new Map(); |
| 457 var keys = js.JsNative.callMethod(js.JsNative.getProperty(js.context, 'Object'
), 'keys', [jsObject]); | 467 var keys = js.JsNative.callMethod(js.JsNative.getProperty(js.context, 'Object'
), 'keys', [jsObject]); |
| 458 for (var key in keys) { | 468 for (var key in keys) { |
| 459 result[key] = wrap_jso(js.JsNative.getProperty(jsObject, key)); | 469 result[key] = wrap_jso(js.JsNative.getProperty(jsObject, key)); |
| 460 } | 470 } |
| 461 return result; | 471 return result; |
| 462 } | 472 } |
| 463 | 473 |
| 464 /** | 474 /** |
| (...skipping 15 matching lines...) Expand all Loading... |
| 480 | 490 |
| 481 return dartClass; | 491 return dartClass; |
| 482 } | 492 } |
| 483 | 493 |
| 484 $else | 494 $else |
| 485 class DartHtmlDomObject extends NativeFieldWrapperClass2 {} | 495 class DartHtmlDomObject extends NativeFieldWrapperClass2 {} |
| 486 | 496 |
| 487 _createCustomUpgrader(Type customElementClass, $this) => $this; | 497 _createCustomUpgrader(Type customElementClass, $this) => $this; |
| 488 | 498 |
| 489 $endif | 499 $endif |
| OLD | NEW |