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 // TODO(terry): Enable below for Dartium w/ interop and remove other static wi
ndow(). | 190 static window() => wrap_jso(js.context['window']); |
191 // static window() => wrap_jso(_blink.Blink_Utils.window()['window']); | |
192 static window() => _blink.Blink_Utils.window(); | |
193 | 191 |
194 static forwardingPrint(String message) => _blink.Blink_Utils.forwardingPrint(m
essage); | 192 static forwardingPrint(String message) => _blink.Blink_Utils.forwardingPrint(m
essage); |
195 static void spawnDomHelper(Function f, int replyTo) => | 193 static void spawnDomHelper(Function f, int replyTo) => |
196 _blink.Blink_Utils.spawnDomHelper(f, replyTo); | 194 _blink.Blink_Utils.spawnDomHelper(f, replyTo); |
197 | 195 |
198 // TODO(vsm): Make this API compatible with spawnUri. It should also | 196 // TODO(vsm): Make this API compatible with spawnUri. It should also |
199 // return a Future<Isolate>. | 197 // return a Future<Isolate>. |
200 static spawnDomUri(String uri) => _blink.Blink_Utils.spawnDomUri(uri); | 198 static spawnDomUri(String uri) => _blink.Blink_Utils.spawnDomUri(uri); |
201 | 199 |
202 // The following methods were added for debugger integration to make working | 200 // The following methods were added for debugger integration to make working |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 | 797 |
800 _register(document, tag, type, extendsTagName); | 798 _register(document, tag, type, extendsTagName); |
801 } | 799 } |
802 | 800 |
803 static void _register(Document document, String tag, Type customType, | 801 static void _register(Document document, String tag, Type customType, |
804 String extendsTagName) => _blink.Blink_Utils.register(unwrap_jso(document),
tag, customType, extendsTagName); | 802 String extendsTagName) => _blink.Blink_Utils.register(unwrap_jso(document),
tag, customType, extendsTagName); |
805 | 803 |
806 static Element createElement(Document document, String tagName) => | 804 static Element createElement(Document document, String tagName) => |
807 wrap_jso(_blink.Blink_Utils.createElement(unwrap_jso(document), tagName)); | 805 wrap_jso(_blink.Blink_Utils.createElement(unwrap_jso(document), tagName)); |
808 | 806 |
809 static void initializeCustomElement(HtmlElement element) => | |
810 _blink.Blink_Utils.initializeCustomElement(unwrap_jso(element)); | |
811 | |
812 static Element changeElementWrapper(HtmlElement element, Type type) => | 807 static Element changeElementWrapper(HtmlElement element, Type type) => |
813 _blink.Blink_Utils.changeElementWrapper(unwrap_jso(element), type); | 808 _blink.Blink_Utils.changeElementWrapper(unwrap_jso(element), type); |
814 } | 809 } |
815 | 810 |
816 class _DOMWindowCrossFrame extends NativeFieldWrapperClass2 implements | 811 class _DOMWindowCrossFrame extends NativeFieldWrapperClass2 implements |
817 WindowBase { | 812 WindowBase { |
818 _DOMWindowCrossFrame.internal(); | 813 _DOMWindowCrossFrame.internal(); |
819 | 814 |
820 // Fields. | 815 // Fields. |
821 HistoryBase get history => _blink.Blink_DOMWindowCrossFrame.get_history(this); | 816 HistoryBase get history => _blink.Blink_DOMWindowCrossFrame.get_history(this); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 void go(int distance) => _blink.Blink_HistoryCrossFrame.go(this, distance); | 861 void go(int distance) => _blink.Blink_HistoryCrossFrame.go(this, distance); |
867 | 862 |
868 // Implementation support. | 863 // Implementation support. |
869 String get typeName => "History"; | 864 String get typeName => "History"; |
870 } | 865 } |
871 | 866 |
872 class _LocationCrossFrame extends NativeFieldWrapperClass2 implements LocationBa
se { | 867 class _LocationCrossFrame extends NativeFieldWrapperClass2 implements LocationBa
se { |
873 _LocationCrossFrame.internal(); | 868 _LocationCrossFrame.internal(); |
874 | 869 |
875 // Fields. | 870 // Fields. |
876 void set href(String h) => _blink.Blink_LocationCrossFrame.set_href(this, h); | 871 set href(String h) => _blink.Blink_LocationCrossFrame.set_href(this, h); |
877 | 872 |
878 // Implementation support. | 873 // Implementation support. |
879 String get typeName => "Location"; | 874 String get typeName => "Location"; |
880 } | 875 } |
881 | 876 |
882 class _DOMStringMap extends NativeFieldWrapperClass2 implements Map<String, Stri
ng> { | 877 class _DOMStringMap extends NativeFieldWrapperClass2 implements Map<String, Stri
ng> { |
883 _DOMStringMap.internal(); | 878 _DOMStringMap.internal(); |
884 | 879 |
885 bool containsValue(String value) => Maps.containsValue(this, value); | 880 bool containsValue(String value) => Maps.containsValue(this, value); |
886 bool containsKey(String key) => _blink.Blink_DOMStringMap.containsKey(this, ke
y); | 881 bool containsKey(String key) => _blink.Blink_DOMStringMap.containsKey(this, ke
y); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1102 new _ScheduleImmediateHelper(); | 1097 new _ScheduleImmediateHelper(); |
1103 | 1098 |
1104 get _scheduleImmediateClosure => (void callback()) { | 1099 get _scheduleImmediateClosure => (void callback()) { |
1105 _scheduleImmediateHelper._schedule(callback); | 1100 _scheduleImmediateHelper._schedule(callback); |
1106 }; | 1101 }; |
1107 | 1102 |
1108 get _pureIsolateScheduleImmediateClosure => ((void callback()) => | 1103 get _pureIsolateScheduleImmediateClosure => ((void callback()) => |
1109 throw new UnimplementedError("scheduleMicrotask in background isolates " | 1104 throw new UnimplementedError("scheduleMicrotask in background isolates " |
1110 "are not supported in the browser")); | 1105 "are not supported in the browser")); |
1111 | 1106 |
1112 void _initializeCustomElement(Element e) { | |
1113 _Utils.initializeCustomElement(e); | |
1114 } | |
1115 | |
1116 // Class for unsupported native browser 'DOM' objects. | 1107 // Class for unsupported native browser 'DOM' objects. |
1117 class _UnsupportedBrowserObject extends NativeFieldWrapperClass2 { | 1108 class _UnsupportedBrowserObject extends NativeFieldWrapperClass2 { |
1118 } | 1109 } |
OLD | NEW |