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 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 try { | 444 try { |
445 if (jsObject is! js.JsObject || jsObject == null) { | 445 if (jsObject is! js.JsObject || jsObject == null) { |
446 // JS Interop converted the object to a Dart class e.g., Uint8ClampedList. | 446 // JS Interop converted the object to a Dart class e.g., Uint8ClampedList. |
447 // or it's a simple type. | 447 // or it's a simple type. |
448 return jsObject; | 448 return jsObject; |
449 } | 449 } |
450 | 450 |
451 var wrapper = js.getDartHtmlWrapperFor(jsObject); | 451 var wrapper = js.getDartHtmlWrapperFor(jsObject); |
452 // if we have a wrapper return the Dart instance. | 452 // if we have a wrapper return the Dart instance. |
453 if (wrapper != null) { | 453 if (wrapper != null) { |
| 454 if (wrapper.runtimeType == HtmlElement && !wrapper._isBadUpgrade) { |
| 455 // We're a Dart instance but we need to upgrade. |
| 456 var customElementClass = _getCustomElementType(wrapper); |
| 457 if (customElementClass != null) { |
| 458 var dartClass_instance; |
| 459 try { |
| 460 dartClass_instance = _blink.Blink_Utils.constructElement(customEleme
ntClass, jsObject); |
| 461 } finally { |
| 462 dartClass_instance.blink_jsObject = jsObject; |
| 463 jsObject['dart_class'] = dartClass_instance; |
| 464 js.setDartHtmlWrapperFor(jsObject, dartClass_instance); |
| 465 return dartClass_instance; |
| 466 } |
| 467 } |
| 468 } |
| 469 |
454 return wrapper; | 470 return wrapper; |
455 } | 471 } |
456 | 472 |
457 if (jsObject is js.JsArray) { | 473 if (jsObject is js.JsArray) { |
458 var wrappingList = new _DartHtmlWrappingList(jsObject); | 474 var wrappingList = new _DartHtmlWrappingList(jsObject); |
459 js.setDartHtmlWrapperFor(jsObject, wrappingList); | 475 js.setDartHtmlWrapperFor(jsObject, wrappingList); |
460 return wrappingList; | 476 return wrappingList; |
461 } | 477 } |
462 | 478 |
463 // Try the most general type conversions on it. | 479 // Try the most general type conversions on it. |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 | 788 |
773 unwrap_jso(dartClass_instance) => dartClass_instance; | 789 unwrap_jso(dartClass_instance) => dartClass_instance; |
774 wrap_jso(jsObject) => jsObject; | 790 wrap_jso(jsObject) => jsObject; |
775 make_dart_rectangle(r) => r; | 791 make_dart_rectangle(r) => r; |
776 convertDartToNative_Dictionary(Map dict) => dict; | 792 convertDartToNative_Dictionary(Map dict) => dict; |
777 List convertDartToNative_StringArray(List<String> input) => input; | 793 List convertDartToNative_StringArray(List<String> input) => input; |
778 convertDartToNative_List(List input) => input; | 794 convertDartToNative_List(List input) => input; |
779 createCustomUpgrader(Type customElementClass, $this) => $this; | 795 createCustomUpgrader(Type customElementClass, $this) => $this; |
780 | 796 |
781 $endif | 797 $endif |
OLD | NEW |