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 /** Needed because KeyboardEvent is implements. | |
814 * TODO(terry): Consider making blink_jsObject private (add underscore) for | |
815 * all blink_jsObject. Then needed private wrap/unwrap_jso | |
816 * functions that delegate to a public wrap/unwrap_jso. | |
817 */ | |
818 js.JsObject blink_jsObject; | |
819 | |
820 _DOMWindowCrossFrame.internal(); | 818 _DOMWindowCrossFrame.internal(); |
821 | 819 |
822 // Fields. | 820 // Fields. |
823 HistoryBase get history => _blink.Blink_DOMWindowCrossFrame.get_history(this); | 821 HistoryBase get history => _blink.Blink_DOMWindowCrossFrame.get_history(this); |
824 LocationBase get location => _blink.Blink_DOMWindowCrossFrame.get_location(thi
s); | 822 LocationBase get location => _blink.Blink_DOMWindowCrossFrame.get_location(thi
s); |
825 bool get closed => _blink.Blink_DOMWindowCrossFrame.get_closed(this); | 823 bool get closed => _blink.Blink_DOMWindowCrossFrame.get_closed(this); |
826 WindowBase get opener => _blink.Blink_DOMWindowCrossFrame.get_opener(this); | 824 WindowBase get opener => _blink.Blink_DOMWindowCrossFrame.get_opener(this); |
827 WindowBase get parent => _blink.Blink_DOMWindowCrossFrame.get_parent(this); | 825 WindowBase get parent => _blink.Blink_DOMWindowCrossFrame.get_parent(this); |
828 WindowBase get top => _blink.Blink_DOMWindowCrossFrame.get_top(this); | 826 WindowBase get top => _blink.Blink_DOMWindowCrossFrame.get_top(this); |
829 | 827 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
868 void go(int distance) => _blink.Blink_HistoryCrossFrame.go(this, distance); | 866 void go(int distance) => _blink.Blink_HistoryCrossFrame.go(this, distance); |
869 | 867 |
870 // Implementation support. | 868 // Implementation support. |
871 String get typeName => "History"; | 869 String get typeName => "History"; |
872 } | 870 } |
873 | 871 |
874 class _LocationCrossFrame extends NativeFieldWrapperClass2 implements LocationBa
se { | 872 class _LocationCrossFrame extends NativeFieldWrapperClass2 implements LocationBa
se { |
875 _LocationCrossFrame.internal(); | 873 _LocationCrossFrame.internal(); |
876 | 874 |
877 // Fields. | 875 // Fields. |
878 set href(String h) => _blink.Blink_LocationCrossFrame.set_href(this, h); | 876 void set href(String h) => _blink.Blink_LocationCrossFrame.set_href(this, h); |
879 | 877 |
880 // Implementation support. | 878 // Implementation support. |
881 String get typeName => "Location"; | 879 String get typeName => "Location"; |
882 } | 880 } |
883 | 881 |
884 class _DOMStringMap extends NativeFieldWrapperClass2 implements Map<String, Stri
ng> { | 882 class _DOMStringMap extends NativeFieldWrapperClass2 implements Map<String, Stri
ng> { |
885 _DOMStringMap.internal(); | 883 _DOMStringMap.internal(); |
886 | 884 |
887 bool containsValue(String value) => Maps.containsValue(this, value); | 885 bool containsValue(String value) => Maps.containsValue(this, value); |
888 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... |
1104 new _ScheduleImmediateHelper(); | 1102 new _ScheduleImmediateHelper(); |
1105 | 1103 |
1106 get _scheduleImmediateClosure => (void callback()) { | 1104 get _scheduleImmediateClosure => (void callback()) { |
1107 _scheduleImmediateHelper._schedule(callback); | 1105 _scheduleImmediateHelper._schedule(callback); |
1108 }; | 1106 }; |
1109 | 1107 |
1110 get _pureIsolateScheduleImmediateClosure => ((void callback()) => | 1108 get _pureIsolateScheduleImmediateClosure => ((void callback()) => |
1111 throw new UnimplementedError("scheduleMicrotask in background isolates " | 1109 throw new UnimplementedError("scheduleMicrotask in background isolates " |
1112 "are not supported in the browser")); | 1110 "are not supported in the browser")); |
1113 | 1111 |
| 1112 void _initializeCustomElement(Element e) { |
| 1113 _Utils.initializeCustomElement(e); |
| 1114 } |
| 1115 |
1114 // Class for unsupported native browser 'DOM' objects. | 1116 // Class for unsupported native browser 'DOM' objects. |
1115 class _UnsupportedBrowserObject extends NativeFieldWrapperClass2 { | 1117 class _UnsupportedBrowserObject extends NativeFieldWrapperClass2 { |
1116 } | 1118 } |
OLD | NEW |