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 // TODO(vsm): Unify with Dartium version. | 7 // TODO(vsm): Unify with Dartium version. |
8 class _DOMWindowCrossFrame implements WindowBase { | 8 class _DOMWindowCrossFrame implements WindowBase { |
9 // Private window. Note, this is a window in another frame, so it | 9 // Private window. Note, this is a window in another frame, so it |
10 // cannot be typed as "Window" as its prototype is not patched | 10 // cannot be typed as "Window" as its prototype is not patched |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 [bool useCapture]) => throw new UnsupportedError( | 76 [bool useCapture]) => throw new UnsupportedError( |
77 'You can only attach EventListeners to your own window.'); | 77 'You can only attach EventListeners to your own window.'); |
78 } | 78 } |
79 | 79 |
80 class _LocationCrossFrame implements LocationBase { | 80 class _LocationCrossFrame implements LocationBase { |
81 // Private location. Note, this is a location object in another frame, so it | 81 // Private location. Note, this is a location object in another frame, so it |
82 // cannot be typed as "Location" as its prototype is not patched | 82 // cannot be typed as "Location" as its prototype is not patched |
83 // properly. Its fields and methods can only be accessed via JavaScript. | 83 // properly. Its fields and methods can only be accessed via JavaScript. |
84 var _location; | 84 var _location; |
85 | 85 |
86 set href(String val) => _setHref(_location, val); | 86 void set href(String val) => _setHref(_location, val); |
87 static void _setHref(location, val) { | 87 static void _setHref(location, val) { |
88 JS('void', '#.href = #', location, val); | 88 JS('void', '#.href = #', location, val); |
89 } | 89 } |
90 | 90 |
91 // Implementation support. | 91 // Implementation support. |
92 _LocationCrossFrame(this._location); | 92 _LocationCrossFrame(this._location); |
93 | 93 |
94 static LocationBase _createSafe(location) { | 94 static LocationBase _createSafe(location) { |
95 if (identical(location, window.location)) { | 95 if (identical(location, window.location)) { |
96 return location; | 96 return location; |
(...skipping 21 matching lines...) Expand all Loading... |
118 | 118 |
119 static HistoryBase _createSafe(h) { | 119 static HistoryBase _createSafe(h) { |
120 if (identical(h, window.history)) { | 120 if (identical(h, window.history)) { |
121 return h; | 121 return h; |
122 } else { | 122 } else { |
123 // TODO(vsm): Cache or implement equality. | 123 // TODO(vsm): Cache or implement equality. |
124 return new _HistoryCrossFrame(h); | 124 return new _HistoryCrossFrame(h); |
125 } | 125 } |
126 } | 126 } |
127 } | 127 } |
OLD | NEW |