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 part of html; | 5 part of html; |
6 | 6 |
7 class _Property { | 7 class _Property { |
8 _Property(this.name) : | 8 _Property(this.name) : |
9 _hasValue = false, | 9 _hasValue = false, |
10 writable = false, | 10 writable = false, |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 } | 180 } |
181 | 181 |
182 static Element getAndValidateNativeType(Type type, String tagName) { | 182 static Element getAndValidateNativeType(Type type, String tagName) { |
183 var element = new Element.tag(tagName); | 183 var element = new Element.tag(tagName); |
184 if (!isTypeSubclassOf(type, element.runtimeType)) { | 184 if (!isTypeSubclassOf(type, element.runtimeType)) { |
185 return null; | 185 return null; |
186 } | 186 } |
187 return element; | 187 return element; |
188 } | 188 } |
189 | 189 |
190 static window() => _blink.Blink_Utils.window(); | 190 static window() => wrap_jso(_blink.Blink_Utils.window()['window']); |
191 static forwardingPrint(String message) => _blink.Blink_Utils.forwardingPrint(m
essage); | 191 static forwardingPrint(String message) => _blink.Blink_Utils.forwardingPrint(m
essage); |
192 static void spawnDomHelper(Function f, int replyTo) => | 192 static void spawnDomHelper(Function f, int replyTo) => |
193 _blink.Blink_Utils.spawnDomHelper(f, replyTo); | 193 _blink.Blink_Utils.spawnDomHelper(f, replyTo); |
194 | 194 |
195 // TODO(vsm): Make this API compatible with spawnUri. It should also | 195 // TODO(vsm): Make this API compatible with spawnUri. It should also |
196 // return a Future<Isolate>. | 196 // return a Future<Isolate>. |
197 static spawnDomUri(String uri) => _blink.Blink_Utils.spawnDomUri(uri); | 197 static spawnDomUri(String uri) => _blink.Blink_Utils.spawnDomUri(uri); |
198 | 198 |
199 // The following methods were added for debugger integration to make working | 199 // The following methods were added for debugger integration to make working |
200 // with the Dart C mirrors API simpler. | 200 // with the Dart C mirrors API simpler. |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 if (nativeClass.reflectedType != HtmlElement) { | 791 if (nativeClass.reflectedType != HtmlElement) { |
792 throw new UnsupportedError('Class must provide extendsTag if base ' | 792 throw new UnsupportedError('Class must provide extendsTag if base ' |
793 'native class is not HTMLElement'); | 793 'native class is not HTMLElement'); |
794 } | 794 } |
795 } | 795 } |
796 | 796 |
797 _register(document, tag, type, extendsTagName); | 797 _register(document, tag, type, extendsTagName); |
798 } | 798 } |
799 | 799 |
800 static void _register(Document document, String tag, Type customType, | 800 static void _register(Document document, String tag, Type customType, |
801 String extendsTagName) => _blink.Blink_Utils.register(document, tag, customT
ype, extendsTagName); | 801 String extendsTagName) => _blink.Blink_Utils.register(unwrap_jso(document),
tag, customType, extendsTagName); |
802 | 802 |
803 static Element createElement(Document document, String tagName) => | 803 static Element createElement(Document document, String tagName) => |
804 _blink.Blink_Utils.createElement(document, tagName); | 804 wrap_jso(_blink.Blink_Utils.createElement(unwrap_jso(document), tagName)); |
805 | 805 |
806 static void initializeCustomElement(HtmlElement element) => | 806 static void initializeCustomElement(HtmlElement element) => |
807 _blink.Blink_Utils.initializeCustomElement(element); | 807 _blink.Blink_Utils.initializeCustomElement(unwrap_jso(element)); |
808 | 808 |
809 static Element changeElementWrapper(HtmlElement element, Type type) => | 809 static Element changeElementWrapper(HtmlElement element, Type type) => |
810 _blink.Blink_Utils.changeElementWrapper(element, type); | 810 _blink.Blink_Utils.changeElementWrapper(unwrap_jso(element), type); |
811 } | 811 } |
812 | 812 |
813 class _DOMWindowCrossFrame extends NativeFieldWrapperClass2 implements | 813 class _DOMWindowCrossFrame extends NativeFieldWrapperClass2 implements |
814 WindowBase { | 814 WindowBase { |
815 _DOMWindowCrossFrame.internal(); | 815 _DOMWindowCrossFrame.internal(); |
816 | 816 |
817 // Fields. | 817 // Fields. |
818 HistoryBase get history => _blink.Blink_DOMWindowCrossFrame.get_history(this); | 818 HistoryBase get history => _blink.Blink_DOMWindowCrossFrame.get_history(this); |
819 LocationBase get location => _blink.Blink_DOMWindowCrossFrame.get_location(thi
s); | 819 LocationBase get location => _blink.Blink_DOMWindowCrossFrame.get_location(thi
s); |
820 bool get closed => _blink.Blink_DOMWindowCrossFrame.get_closed(this); | 820 bool get closed => _blink.Blink_DOMWindowCrossFrame.get_closed(this); |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1106 throw new UnimplementedError("scheduleMicrotask in background isolates " | 1106 throw new UnimplementedError("scheduleMicrotask in background isolates " |
1107 "are not supported in the browser")); | 1107 "are not supported in the browser")); |
1108 | 1108 |
1109 void _initializeCustomElement(Element e) { | 1109 void _initializeCustomElement(Element e) { |
1110 _Utils.initializeCustomElement(e); | 1110 _Utils.initializeCustomElement(e); |
1111 } | 1111 } |
1112 | 1112 |
1113 // Class for unsupported native browser 'DOM' objects. | 1113 // Class for unsupported native browser 'DOM' objects. |
1114 class _UnsupportedBrowserObject extends NativeFieldWrapperClass2 { | 1114 class _UnsupportedBrowserObject extends NativeFieldWrapperClass2 { |
1115 } | 1115 } |
OLD | NEW |