/** * Returns the (i)frame in which the window is contained. * @return {@code null} for a top level window */ @JsxGetter public Object getFrameElement() { final WebWindow window = getWebWindow(); if (window instanceof FrameWindow) { return ((FrameWindow) window).getFrameElement().getScriptableObject(); } return null; }
/** * Returns the (i)frame in which the window is contained. * @return {@code null} for a top level window */ @JsxGetter public Object getFrameElement() { final WebWindow window = getWebWindow(); if (window instanceof FrameWindow) { return ((FrameWindow) window).getFrameElement().getScriptableObject(); } return null; }
try { final FrameWindow frame = ((HtmlPage) page).getFrameByName(name); final ScriptableObject scriptable = frame.getFrameElement().getScriptableObject(); if (scriptable instanceof HTMLIFrameElement) { ((HTMLIFrameElement) scriptable).onRefresh();
/** * {@inheritDoc} */ @Override @JsxFunction(FF) public void close() throws IOException { if (writeInCurrentDocument_) { LOG.warn("close() called when document is not open."); } else { final HtmlPage page = getPage(); final URL url = page.getUrl(); final StringWebResponse webResponse = new StringWebResponse(writeBuilder_.toString(), url); webResponse.setFromJavascript(true); writeInCurrentDocument_ = true; writeBuilder_.setLength(0); final WebClient webClient = page.getWebClient(); final WebWindow window = page.getEnclosingWindow(); // reset isAttachedToPageDuringOnload_ to trigger the onload event for chrome also if (window instanceof FrameWindow) { final BaseFrameElement frame = ((FrameWindow) window).getFrameElement(); final ScriptableObject scriptable = frame.getScriptableObject(); if (scriptable instanceof HTMLIFrameElement) { ((HTMLIFrameElement) scriptable).onRefresh(); } } webClient.loadWebResponseInto(webResponse, window); } }
try { final FrameWindow frame = ((HtmlPage) page).getFrameByName(name); final ScriptableObject scriptable = frame.getFrameElement().getScriptableObject(); if (scriptable instanceof HTMLIFrameElement) { ((HTMLIFrameElement) scriptable).onRefresh();
/** * {@inheritDoc} */ @Override @JsxFunction(FF) public void close() throws IOException { if (writeInCurrentDocument_) { LOG.warn("close() called when document is not open."); } else { final HtmlPage page = getPage(); final URL url = page.getUrl(); final StringWebResponse webResponse = new StringWebResponse(writeBuilder_.toString(), url); webResponse.setFromJavascript(true); writeInCurrentDocument_ = true; writeBuilder_.setLength(0); final WebClient webClient = page.getWebClient(); final WebWindow window = page.getEnclosingWindow(); // reset isAttachedToPageDuringOnload_ to trigger the onload event for chrome also if (window instanceof FrameWindow) { final BaseFrameElement frame = ((FrameWindow) window).getFrameElement(); final ScriptableObject scriptable = frame.getScriptableObject(); if (scriptable instanceof HTMLIFrameElement) { ((HTMLIFrameElement) scriptable).onRefresh(); } } webClient.loadWebResponseInto(webResponse, window); } }
/** * Sets the specified element as the document's active element. * @see HTMLElement#setActive() * @param element the new active element for this document */ public void setActiveElement(final HTMLElement element) { // TODO update page focus element also activeElement_ = element; if (element != null) { // if this is part of an iFrame, make the iFrame tag the // active element of his doc final WebWindow window = element.getDomNodeOrDie().getPage().getEnclosingWindow(); if (window instanceof FrameWindow) { final BaseFrameElement frame = ((FrameWindow) window).getFrameElement(); if (frame instanceof HtmlInlineFrame) { final Window winWithFrame = frame.getPage().getEnclosingWindow().getScriptableObject(); ((HTMLDocument) winWithFrame.getDocument()).setActiveElement( (HTMLElement) frame.getScriptableObject()); } } } }
/** * Sets the specified element as the document's active element. * @see HTMLElement#setActive() * @param element the new active element for this document */ public void setActiveElement(final HTMLElement element) { // TODO update page focus element also activeElement_ = element; if (element != null) { // if this is part of an iFrame, make the iFrame tag the // active element of his doc final WebWindow window = element.getDomNodeOrDie().getPage().getEnclosingWindow(); if (window instanceof FrameWindow) { final BaseFrameElement frame = ((FrameWindow) window).getFrameElement(); if (frame instanceof HtmlInlineFrame) { final Window winWithFrame = frame.getPage().getEnclosingWindow().getScriptableObject(); ((HTMLDocument) winWithFrame.getDocument()).setActiveElement( (HTMLElement) frame.getScriptableObject()); } } } }
((Node) frame.getScriptableObject()).executeEventLocally(event);
final Object element = frameElement.getScriptableObject(); final HTMLElement htmlElement = (HTMLElement) element; final ComputedCSSStyleDeclaration style =
((Node) frame.getScriptableObject()).executeEventLocally(event);
final Object element = frameElement.getScriptableObject(); final HTMLElement htmlElement = (HTMLElement) element; final ComputedCSSStyleDeclaration style =