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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 11428033: Window.close documentation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/html/src/CrossFrameTypes.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index a95a00e84402ca51651da4bbfd413eb84938e9fa..bc54d80415f3460f8d20ecf592976e4b68c63c33 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -28507,7 +28507,7 @@ abstract class Window {
History get history;
/**
- * Indicates whether this window is closed.
+ * Indicates whether this window has been closed.
*
* print(window.closed); // 'false'
* window.close();
@@ -28560,6 +28560,34 @@ abstract class Window {
Window get top;
// Methods.
+ /**
+ * Closes the window.
+ *
+ * This method should only succeed if the [Window] object is
+ * **script-closeable** and the window calling [close] is allowed to navigate
+ * the window.
+ *
+ * A window is script-closeable if it is either a window
+ * that was opened by another window, or if it is a window with only one
+ * document in its history.
+ *
+ * A window might not be allowed to navigate, and therefore close, another
+ * window due to browser security features.
+ *
+ * var other = window.open('http://www.example.com', 'foo');
+ * // Closes other window, as it is script-closeable.
+ * other.close();
+ * print(other.closed()); // 'true'
+ *
+ * window.location('http://www.mysite.com', 'foo');
+ * // Does not close this window, as the history has changed.
+ * window.close();
+ * print(window.closed()); // 'false'
+ *
+ * See also:
+ *
+ * * [Window close discussion](http://www.w3.org/TR/html5/browsers.html#dom-window-close) from the W3C
+ */
void close();
void postMessage(var message, String targetOrigin, [List messagePorts = null]);
}
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | sdk/lib/html/src/CrossFrameTypes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698