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

Unified Diff: sdk/lib/html/src/CrossFrameTypes.dart

Issue 11416081: Added a lot more documentation to Window. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/src/CrossFrameTypes.dart
diff --git a/sdk/lib/html/src/CrossFrameTypes.dart b/sdk/lib/html/src/CrossFrameTypes.dart
index 8f8134d62b61efc0eb31b5b32f14cad8c4a13fdb..0c99356b432b0f6c47dac0b3e37545c24983875c 100644
--- a/sdk/lib/html/src/CrossFrameTypes.dart
+++ b/sdk/lib/html/src/CrossFrameTypes.dart
@@ -22,12 +22,67 @@ part of html;
*/
abstract class Window {
// Fields.
+
+ /**
+ * The [Location] object representing the current location of this window.
Kathy Walrath 2012/11/20 00:04:21 I think we can just say: * The current location o
Andrei Mouravski 2012/11/20 00:15:38 Done.
+ *
+ * Location currentLocation = window.location;
+ * print(currentLocation.href); // 'http://www.example.com:80/'
+ */
Location get location;
History get history;
+ /**
+ * Indicates whether the window is closed.
Kathy Walrath 2012/11/20 00:04:21 the -> this
Andrei Mouravski 2012/11/20 00:15:38 Done.
+ *
+ * print(window.closed); // 'false'
+ * window.close();
+ * print(window.closed); // 'true'
+ */
bool get closed;
+
+ /**
+ * A reference to the [Window] that opened this [Window].
Kathy Walrath 2012/11/20 00:04:21 change to: A reference to the window that opened
Andrei Mouravski 2012/11/20 00:15:38 Done.
+ *
+ * Window thisWindow = window;
+ * Window otherWindow = thisWindow.open('http://www.example.com/', 'foo');
+ * print(otherWindow.opener == thisWindow); // 'true'
+ */
Window get opener;
+
+ /**
+ * A reference to the parent of this [Window].
Kathy Walrath 2012/11/20 00:04:21 [Window] -> window
Andrei Mouravski 2012/11/20 00:15:38 Done.
+ *
+ * If this [Window] has no parent, [parent] will return a reference to
+ * the [Window] itself.
+ *
+ * IFrameElement myIFrame = new IFrameElement();
+ * window.document.body.elements.add(myIFrame);
+ * print(myIframe.contentWindow.parent == window) // 'true'
+ *
+ * print(window.parent == window) // 'true'
+ */
Window get parent;
+
+ /**
+ * A reference to the topmost [Window] in the [Window] heirarchy.
Kathy Walrath 2012/11/20 00:04:21 again, [Window] -> window
Andrei Mouravski 2012/11/20 00:15:38 Done.
+ *
+ * If this [Window] is the topmost [Window], [top] will return a reference to
+ * the [Window] itself.
+ *
+ * // Add an IFrame to the current window.
+ * IFrameElement myIFrame = new IFrameElement();
+ * window.document.body.elements.add(myIFrame);
+ *
+ * // Add an IFrame inside of the other IFrame.
+ * IFrameElement innerIFrame = new IFrameElement();
+ * myIFrame.elements.add(innerIFrame);
+ *
+ * print(myIframe.contentWindow.top == window) // 'true'
+ * print(innerIFrame.contentWindow.top == window) // 'true'
+ *
+ * print(window.top == window) // 'true'
+ */
Window get top;
// Methods.
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698