code: public void setCurrentFrame(RemoteWebElement iframe, RemoteWebElement document,
                                RemoteWebElement window) {
      this.iframe = iframe;
      this.document = document;
      this.window = window;
  
      if (iframe != null) {
        isOnMainFrame = false;
      } else {
        isOnMainFrame = true;
      }
  
      // switchToDefaultContent. revert to main document if it was set.
      if (iframe == null && document == null) {
        this.document = mainDocument;
        this.window = mainWindow;
      }
  
      // setting the main document for the first time
      if (iframe == null && document != null) {
        mainDocument = document;
        mainWindow = window;
      }
      isReady = true;
  
    }
docs: breaks the nodeId reference.