bug 1523104: remote: fix WindowManager docs; r=me a=docs
authorAndreas Tolfsen <ato@sny.no>
Fri, 08 Mar 2019 14:03:51 +0000
changeset 521145 25dd3f1e01c9
parent 521144 56727ea2555c
child 521146 2932c11d19a5
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, docs
bugs1523104
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1523104: remote: fix WindowManager docs; r=me a=docs
remote/WindowManager.jsm
--- a/remote/WindowManager.jsm
+++ b/remote/WindowManager.jsm
@@ -9,33 +9,34 @@ var EXPORTED_SYMBOLS = [
   "WindowObserver",
 ];
 
 const {DOMContentLoadedPromise} = ChromeUtils.import("chrome://remote/content/Sync.jsm");
 const {EventEmitter} = ChromeUtils.import("resource://gre/modules/EventEmitter.jsm");
 const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 /**
- * The WindowManager provides tooling for application-agnostic observation
- * of windows, tabs, and content browsers as they are created and destroyed.
+ * The WindowManager provides tooling for application-agnostic
+ * observation of windows, tabs, and content browsers as they are
+ * created and destroyed.
  */
 
 // TODO(ato):
 //
 // The DOM team is working on pulling browsing context related behaviour,
 // such as window and tab handling, out of product code and into the platform.
 // This will have implication for the remote agent,
 // and as the platform gains support for product-independent events
 // we can likely get rid of this entire module.
 
 /**
  * Observes DOMWindows as they open and close.
  *
- * The WindowObserver.Event.Open event fires when a window opens.
- * The WindowObserver.Event.Close event fires when a window closes.
+ * "open" fires when a window opens.
+ * "close" fires when a window closes.
  */
 class WindowObserver {
   /**
    * @param {boolean?} [false] registerExisting
    *     Events will be despatched for the ChromeWindows that exist
    *     at the time the observer is started.
    */
   constructor({registerExisting = false} = {}) {
@@ -121,18 +122,18 @@ class TabObserver {
   // WindowObserver
 
   async onWindowOpen(eventName, window) {
     if (!window.gBrowser) {
       return;
     }
 
     for (const tab of window.gBrowser.tabs) {
-      // If `linkedBrowser` isn't set, it means that the tab is still initializing
-      // and a `TabOpen` event will be fired once it is all set.
+      // a missing linkedBrowser means the tab is still initialising,
+      // and a TabOpen event will fire once it is ready
       if (!tab.linkedBrowser) {
         continue;
       }
       this.onTabOpen(tab);
     }
 
     window.addEventListener("TabOpen", ({target}) => this.onTabOpen(target));
     window.addEventListener("TabClose", ({target}) => this.onTabClose(target));