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