Пример #1
0
  /** {@inheritDoc} */
  public void setEnclosedPage(final Page page) {
    super.setEnclosedPage(page);

    // we have updated a frame window by javascript write();
    // so we have to disable future updates during initialization
    // see com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames()
    final WebResponse webResponse = page.getWebResponse();
    if (webResponse instanceof StringWebResponse) {
      final StringWebResponse response = (StringWebResponse) webResponse;
      if (response.isFromJavascript()) {
        final BaseFrame frame = getFrameElement();
        frame.setContentLoaded();
      }
    }
  }
Пример #2
0
 /** Creates an instance for a given frame. */
 FrameWindow(final BaseFrame frame) {
   super(frame.getPage().getWebClient());
   frame_ = frame;
   final WebWindowImpl parent = (WebWindowImpl) getParentWindow();
   performRegistration();
   parent.addChildWindow(this);
 }
Пример #3
0
 /**
  * Returns the HTML page in which the <frame> or <iframe> tag is contained for this
  * frame window. This is a facility method for <code>
  * (HtmlPage) (getParentWindow().getEnclosedPage())</code>.
  *
  * @return the page in the parent window
  */
 public HtmlPage getEnclosingPage() {
   return (HtmlPage) frame_.getPage();
 }
Пример #4
0
 /** {@inheritDoc} */
 public WebWindow getParentWindow() {
   return frame_.getPage().getEnclosingWindow();
 }
Пример #5
0
 /** {@inheritDoc} A FrameWindow shares it's name with it's containing frame. */
 @Override
 public void setName(final String name) {
   frame_.setNameAttribute(name);
 }
Пример #6
0
 /** {@inheritDoc} A FrameWindow shares it's name with it's containing frame. */
 @Override
 public String getName() {
   return frame_.getNameAttribute();
 }