OLD | NEW |
---|---|
1 /** | 1 /** |
2 * HTML elements and other resources for web-based applications that need to | 2 * HTML elements and other resources for web-based applications that need to |
3 * interact with the browser and the DOM (Document Object Model). | 3 * interact with the browser and the DOM (Document Object Model). |
4 * | 4 * |
5 * This library includes DOM element types, CSS styling, local storage, | 5 * This library includes DOM element types, CSS styling, local storage, |
6 * media, speech, events, and more. | 6 * media, speech, events, and more. |
7 * To get started, | 7 * To get started, |
8 * check out the [Element] class, the base class for many of the HTML | 8 * check out the [Element] class, the base class for many of the HTML |
9 * DOM types. | 9 * DOM types. |
10 * | 10 * |
(...skipping 3934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3945 | 3945 |
3946 /** Sets the value of "zoom" */ | 3946 /** Sets the value of "zoom" */ |
3947 set zoom(String value) { | 3947 set zoom(String value) { |
3948 setProperty('zoom', value, ''); | 3948 setProperty('zoom', value, ''); |
3949 } | 3949 } |
3950 } | 3950 } |
3951 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3951 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
3952 // for details. All rights reserved. Use of this source code is governed by a | 3952 // for details. All rights reserved. Use of this source code is governed by a |
3953 // BSD-style license that can be found in the LICENSE file. | 3953 // BSD-style license that can be found in the LICENSE file. |
3954 | 3954 |
3955 // WARNING: Do not edit - generated code. | |
3956 | |
3957 | |
3958 @DomName('CustomEvent') | |
3959 @Native("CustomEvent") | |
3960 class CustomEvent extends Event { | |
3961 var _dartDetail; | |
3962 | |
3963 factory CustomEvent(String type, | |
3964 {bool canBubble: true, bool cancelable: true, Object detail}) { | |
3965 | |
3966 final CustomEvent e = document._createEvent('CustomEvent'); | |
3967 | |
3968 e._dartDetail = detail; | |
3969 | |
3970 // Only try setting the detail if it's one of these types to avoid | |
3971 // first-chance exceptions. Can expand this list in the future as needed. | |
3972 if (detail is List || detail is Map || detail is String || detail is num) { | |
3973 try { | |
Jacob
2016/01/28 17:57:42
you sure this works?
i'm having trouble figuring o
| |
3974 e._initCustomEvent(type, canBubble, cancelable, detail); | |
3975 } catch(_) { | |
3976 e._initCustomEvent(type, canBubble, cancelable, null); | |
3977 } | |
3978 } else { | |
3979 e._initCustomEvent(type, canBubble, cancelable, null); | |
3980 } | |
3981 | |
3982 return e; | |
3983 } | |
3984 | |
3985 @DomName('CustomEvent.detail') | |
3986 get detail { | |
3987 if (_dartDetail != null) { | |
3988 return _dartDetail; | |
3989 } | |
3990 return _detail; | |
3991 } | |
3992 // To suppress missing implicit constructor warnings. | |
3993 factory CustomEvent._() { throw new UnsupportedError("Not supported"); } | |
3994 | |
3995 | |
3996 @Deprecated("Internal Use Only") | |
3997 static CustomEvent internalCreateCustomEvent() { | |
3998 return new CustomEvent.internal_(); | |
3999 } | |
4000 | |
4001 @Deprecated("Internal Use Only") | |
4002 CustomEvent.internal_() : super.internal_(); | |
4003 | |
4004 | |
4005 @DomName('CustomEvent._detail') | |
4006 @DocsEditable() | |
4007 @Experimental() // untriaged | |
4008 dynamic get _detail => convertNativeToDart_SerializedScriptValue(this._get__de tail); | |
4009 @JSName('detail') | |
4010 @DomName('CustomEvent._detail') | |
4011 @DocsEditable() | |
4012 @Experimental() // untriaged | |
4013 @Creates('Null') | |
4014 dynamic get _get__detail => wrap_jso(JS("dynamic", "#.detail", this.raw)); | |
4015 | |
4016 @DomName('CustomEvent.initCustomEvent') | |
4017 @DocsEditable() | |
4018 void _initCustomEvent(String typeArg, bool canBubbleArg, bool cancelableArg, O bject detailArg) { | |
4019 _initCustomEvent_1(typeArg, canBubbleArg, cancelableArg, detailArg); | |
4020 return; | |
4021 } | |
4022 @JSName('initCustomEvent') | |
4023 @DomName('CustomEvent.initCustomEvent') | |
4024 @DocsEditable() | |
4025 void _initCustomEvent_1(typeArg, canBubbleArg, cancelableArg, detailArg) => wr ap_jso(JS("void ", "#.raw.initCustomEvent(#, #, #, #)", this, unwrap_jso(typeArg ), unwrap_jso(canBubbleArg), unwrap_jso(cancelableArg), unwrap_jso(detailArg))); | |
4026 | |
4027 } | |
4028 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
4029 // for details. All rights reserved. Use of this source code is governed by a | |
4030 // BSD-style license that can be found in the LICENSE file. | |
4031 | |
3955 | 4032 |
3956 @DocsEditable() | 4033 @DocsEditable() |
3957 /** | 4034 /** |
3958 * A generic container for content on an HTML page; | 4035 * A generic container for content on an HTML page; |
3959 * corresponds to the <div> tag. | 4036 * corresponds to the <div> tag. |
3960 * | 4037 * |
3961 * The [DivElement] is a generic container and does not have any semantic | 4038 * The [DivElement] is a generic container and does not have any semantic |
3962 * significance. It is functionally similar to [SpanElement]. | 4039 * significance. It is functionally similar to [SpanElement]. |
3963 * | 4040 * |
3964 * The [DivElement] is a block-level element, as opposed to [SpanElement], | 4041 * The [DivElement] is a block-level element, as opposed to [SpanElement], |
(...skipping 15633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
19598 'JsFunction': () => js.JsFunctionImpl, | 19675 'JsFunction': () => js.JsFunctionImpl, |
19599 'JsArray': () => js.JsArrayImpl, | 19676 'JsArray': () => js.JsArrayImpl, |
19600 'Attr': () => _Attr, | 19677 'Attr': () => _Attr, |
19601 'CSSStyleDeclaration': () => CssStyleDeclaration, | 19678 'CSSStyleDeclaration': () => CssStyleDeclaration, |
19602 'CharacterData': () => CharacterData, | 19679 'CharacterData': () => CharacterData, |
19603 'ChildNode': () => ChildNode, | 19680 'ChildNode': () => ChildNode, |
19604 'ClientRect': () => _ClientRect, | 19681 'ClientRect': () => _ClientRect, |
19605 'Comment': () => Comment, | 19682 'Comment': () => Comment, |
19606 'Console': () => Console, | 19683 'Console': () => Console, |
19607 'ConsoleBase': () => ConsoleBase, | 19684 'ConsoleBase': () => ConsoleBase, |
19685 'CustomEvent': () => CustomEvent, | |
19608 'DOMImplementation': () => DomImplementation, | 19686 'DOMImplementation': () => DomImplementation, |
19609 'DOMTokenList': () => DomTokenList, | 19687 'DOMTokenList': () => DomTokenList, |
19610 'Document': () => Document, | 19688 'Document': () => Document, |
19611 'DocumentFragment': () => DocumentFragment, | 19689 'DocumentFragment': () => DocumentFragment, |
19612 'Element': () => Element, | 19690 'Element': () => Element, |
19613 'Event': () => Event, | 19691 'Event': () => Event, |
19614 'EventTarget': () => EventTarget, | 19692 'EventTarget': () => EventTarget, |
19615 'HTMLAnchorElement': () => AnchorElement, | 19693 'HTMLAnchorElement': () => AnchorElement, |
19616 'HTMLBaseElement': () => BaseElement, | 19694 'HTMLBaseElement': () => BaseElement, |
19617 'HTMLBodyElement': () => BodyElement, | 19695 'HTMLBodyElement': () => BodyElement, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
19650 | 19728 |
19651 // FIXME: Can we make this private? | 19729 // FIXME: Can we make this private? |
19652 final htmlBlinkFunctionMap = { | 19730 final htmlBlinkFunctionMap = { |
19653 'Attr': () => _Attr.internalCreate_Attr, | 19731 'Attr': () => _Attr.internalCreate_Attr, |
19654 'CSSStyleDeclaration': () => CssStyleDeclaration.internalCreateCssStyleDeclara tion, | 19732 'CSSStyleDeclaration': () => CssStyleDeclaration.internalCreateCssStyleDeclara tion, |
19655 'CharacterData': () => CharacterData.internalCreateCharacterData, | 19733 'CharacterData': () => CharacterData.internalCreateCharacterData, |
19656 'ClientRect': () => _ClientRect.internalCreate_ClientRect, | 19734 'ClientRect': () => _ClientRect.internalCreate_ClientRect, |
19657 'Comment': () => Comment.internalCreateComment, | 19735 'Comment': () => Comment.internalCreateComment, |
19658 'Console': () => Console.internalCreateConsole, | 19736 'Console': () => Console.internalCreateConsole, |
19659 'ConsoleBase': () => ConsoleBase.internalCreateConsoleBase, | 19737 'ConsoleBase': () => ConsoleBase.internalCreateConsoleBase, |
19738 'CustomEvent': () => CustomEvent.internalCreateCustomEvent, | |
19660 'DOMImplementation': () => DomImplementation.internalCreateDomImplementation, | 19739 'DOMImplementation': () => DomImplementation.internalCreateDomImplementation, |
19661 'DOMTokenList': () => DomTokenList.internalCreateDomTokenList, | 19740 'DOMTokenList': () => DomTokenList.internalCreateDomTokenList, |
19662 'Document': () => Document.internalCreateDocument, | 19741 'Document': () => Document.internalCreateDocument, |
19663 'DocumentFragment': () => DocumentFragment.internalCreateDocumentFragment, | 19742 'DocumentFragment': () => DocumentFragment.internalCreateDocumentFragment, |
19664 'Element': () => Element.internalCreateElement, | 19743 'Element': () => Element.internalCreateElement, |
19665 'Event': () => Event.internalCreateEvent, | 19744 'Event': () => Event.internalCreateEvent, |
19666 'EventTarget': () => EventTarget.internalCreateEventTarget, | 19745 'EventTarget': () => EventTarget.internalCreateEventTarget, |
19667 'HTMLAnchorElement': () => AnchorElement.internalCreateAnchorElement, | 19746 'HTMLAnchorElement': () => AnchorElement.internalCreateAnchorElement, |
19668 'HTMLBaseElement': () => BaseElement.internalCreateBaseElement, | 19747 'HTMLBaseElement': () => BaseElement.internalCreateBaseElement, |
19669 'HTMLBodyElement': () => BodyElement.internalCreateBodyElement, | 19748 'HTMLBodyElement': () => BodyElement.internalCreateBodyElement, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
19712 return null; | 19791 return null; |
19713 } | 19792 } |
19714 | 19793 |
19715 Function _getHtmlFunction(String key) { | 19794 Function _getHtmlFunction(String key) { |
19716 if (htmlBlinkFunctionMap.containsKey(key)) { | 19795 if (htmlBlinkFunctionMap.containsKey(key)) { |
19717 return htmlBlinkFunctionMap[key](); | 19796 return htmlBlinkFunctionMap[key](); |
19718 } | 19797 } |
19719 return null; | 19798 return null; |
19720 } | 19799 } |
19721 | 19800 |
OLD | NEW |