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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 /// libraries. | 457 /// libraries. |
458 class DartHtmlDomObject { | 458 class DartHtmlDomObject { |
459 | 459 |
460 /// The underlying JS DOM object. | 460 /// The underlying JS DOM object. |
461 js.JsObject blink_jsObject; | 461 js.JsObject blink_jsObject; |
462 | 462 |
463 } | 463 } |
464 | 464 |
465 // Flag to disable JS interop asserts. Setting to false will speed up the | 465 // Flag to disable JS interop asserts. Setting to false will speed up the |
466 // wrap_jso calls. | 466 // wrap_jso calls. |
467 bool __interop_checks = true; | 467 bool __interop_checks = false; |
468 | 468 |
469 /** Expando for JsObject, used by every Dart class associated with a Javascript | 469 /** Expando for JsObject, used by every Dart class associated with a Javascript |
470 * class (e.g., DOM, WebAudio, etc.). | 470 * class (e.g., DOM, WebAudio, etc.). |
471 */ | 471 */ |
472 | 472 |
473 /** | 473 /** |
474 * Return the JsObject associated with a Dart class [dartClass_instance]. | 474 * Return the JsObject associated with a Dart class [dartClass_instance]. |
475 */ | 475 */ |
476 unwrap_jso(dartClass_instance) => js.unwrap_jso(dartClass_instance); | 476 unwrap_jso(dartClass_instance) => js.unwrap_jso(dartClass_instance); |
477 | 477 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 var dartClass_instance; | 542 var dartClass_instance; |
543 var customElementClass = null; | 543 var customElementClass = null; |
544 var extendsTag = ""; | 544 var extendsTag = ""; |
545 var custom = _getCustomElementEntry(jsObject); | 545 var custom = _getCustomElementEntry(jsObject); |
546 if (custom != null) { | 546 if (custom != null) { |
547 customElementClass = custom['type']; | 547 customElementClass = custom['type']; |
548 extendsTag = custom['extends']; | 548 extendsTag = custom['extends']; |
549 } | 549 } |
550 | 550 |
551 // Custom Element to upgrade. | 551 // Custom Element to upgrade. |
552 if (customElementClass != null && extendsTag == "") { | 552 // Only allow custome elements to be created in the html or svg default |
| 553 // namespace. |
| 554 var defaultNS = jsObject['namespaceURI'] == 'http://www.w3.org/1999/xhtml' |
| |
| 555 jsObject['namespaceURI'] == 'http://www.w3.org/2000/svg'; |
| 556 if (customElementClass != null && extendsTag == "" && defaultNS) { |
553 try { | 557 try { |
554 dartClass_instance = _blink.Blink_Utils.constructElement(customElementCl
ass, jsObject); | 558 dartClass_instance = _blink.Blink_Utils.constructElement(customElementCl
ass, jsObject); |
555 } finally { | 559 } finally { |
556 dartClass_instance.blink_jsObject = jsObject; | 560 dartClass_instance.blink_jsObject = jsObject; |
557 js.setDartHtmlWrapperFor(jsObject, dartClass_instance); | 561 js.setDartHtmlWrapperFor(jsObject, dartClass_instance); |
558 } | 562 } |
559 } else { | 563 } else { |
560 var func = getHtmlCreateFunction(jsTypeName); | 564 var func = getHtmlCreateFunction(jsTypeName); |
561 if (func == null) { | 565 if (func == null) { |
562 if (jsTypeName == 'auto-binding') { | 566 if (jsTypeName == 'auto-binding') { |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 | 821 |
818 unwrap_jso(dartClass_instance) => dartClass_instance; | 822 unwrap_jso(dartClass_instance) => dartClass_instance; |
819 wrap_jso(jsObject) => jsObject; | 823 wrap_jso(jsObject) => jsObject; |
820 make_dart_rectangle(r) => r; | 824 make_dart_rectangle(r) => r; |
821 convertDartToNative_Dictionary(Map dict) => dict; | 825 convertDartToNative_Dictionary(Map dict) => dict; |
822 List convertDartToNative_StringArray(List<String> input) => input; | 826 List convertDartToNative_StringArray(List<String> input) => input; |
823 convertDartToNative_List(List input) => input; | 827 convertDartToNative_List(List input) => input; |
824 createCustomUpgrader(Type customElementClass, $this) => $this; | 828 createCustomUpgrader(Type customElementClass, $this) => $this; |
825 | 829 |
826 $endif | 830 $endif |
OLD | NEW |