Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: lib/html/src/frog_DOMImplementation.dart

Issue 10332105: Minimal fix to get cross frame tests working, take #2. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Regen html_dartium.dart Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/html/frog/html_frog.dart ('k') | tests/html/html.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/html/src/frog_DOMImplementation.dart
diff --git a/lib/html/src/frog_DOMImplementation.dart b/lib/html/src/frog_DOMImplementation.dart
new file mode 100644
index 0000000000000000000000000000000000000000..c77f271c3b2767c358ced0d8851b084d4858724a
--- /dev/null
+++ b/lib/html/src/frog_DOMImplementation.dart
@@ -0,0 +1,47 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// TODO(vsm): Unify with Dartium version.
+class _DOMWindowCrossFrameImpl implements Window {
+ // Private window.
+ _WindowImpl _window;
+
+ // Fields.
+ // TODO(vsm): Implement history and location getters.
+
+ bool get closed() => _window.closed;
+ int get length() => _window.length;
+ Window get opener() => _createSafe(_window.opener);
+ Window get parent() => _createSafe(_window.parent);
+ Window get top() => _createSafe(_window.top);
+
+ // Methods.
+ void focus() => _window.focus();
+
+ void blur() => _window.blur();
+
+ void close() => _window.close();
+
+ void postMessage(Dynamic message,
+ String targetOrigin,
+ [List messagePorts = null]) {
+ if (messagePorts == null) {
+ _window.postMessage(message, targetOrigin);
+ } else {
+ _window.postMessage(message, targetOrigin, messagePorts);
+ }
+ }
+
+ // Implementation support.
+ _DOMWindowCrossFrameImpl(this._window);
+
+ static Window _createSafe(w) {
+ if (w === window) {
+ return w;
+ } else {
+ // TODO(vsm): Cache or implement equality.
+ return new _DOMWindowCrossFrameImpl(w);
+ }
+ }
+}
« no previous file with comments | « lib/html/frog/html_frog.dart ('k') | tests/html/html.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698