/** {@inheritDoc} */ @Override public void startDTD(final String name, final String publicId, final String systemId) { final DomDocumentType type = new DomDocumentType(page_, name, publicId, systemId); page_.setDocumentType(type); final Node child; child = type; page_.appendChild(child); }
/** {@inheritDoc} */ @Override public void startDTD(final String name, final String publicId, final String systemId) { final DomDocumentType type = new DomDocumentType(page_, name, publicId, systemId); page_.setDocumentType(type); final Node child; child = type; page_.appendChild(child); }
/** * {@inheritDoc} */ @Override public HtmlPage cloneNode(final boolean deep) { // we need the ScriptObject clone before cloning the kids. final HtmlPage result = (HtmlPage) super.cloneNode(false); final SimpleScriptable jsObjClone = ((SimpleScriptable) getScriptableObject()).clone(); jsObjClone.setDomNode(result); // if deep, clone the kids too, and re initialize parts of the clone if (deep) { synchronized (lock_) { result.attributeListeners_ = null; } result.selectionRanges_ = new ArrayList<>(3); result.afterLoadActions_ = new ArrayList<>(); result.frameElements_ = new TreeSet<>(documentPositionComparator); for (DomNode child = getFirstChild(); child != null; child = child.getNextSibling()) { result.appendChild(child.cloneNode(true)); } } return result; }
/** * {@inheritDoc} */ @Override public HtmlPage cloneNode(final boolean deep) { // we need the ScriptObject clone before cloning the kids. final HtmlPage result = (HtmlPage) super.cloneNode(false); final SimpleScriptable jsObjClone = ((SimpleScriptable) getScriptableObject()).clone(); jsObjClone.setDomNode(result); // if deep, clone the kids too, and re initialize parts of the clone if (deep) { synchronized (lock_) { result.attributeListeners_ = null; } result.selectionRanges_ = new ArrayList<>(3); result.afterLoadActions_ = new ArrayList<>(); result.frameElements_ = new TreeSet<>(documentPositionComparator); for (DomNode child = getFirstChild(); child != null; child = child.getNextSibling()) { result.appendChild(child.cloneNode(true)); } } return result; }
void init(final Window openerJSWindow) { // build document document_ = new HTMLDocument(); document_.setPrototype(openerJSWindow.getPrototype(HTMLDocument.class)); document_.setParentScope(this); final WebWindow openerWindow = openerJSWindow.getWebWindow(); // create the "page" associated to the document final WebWindow popupPseudoWindow = new PopupPseudoWebWindow(openerWindow.getWebClient()); // take the WebResponse of the opener (not really correct, but...) final WebResponse webResponse = openerWindow.getEnclosedPage().getWebResponse(); final HtmlPage popupPage = new HtmlPage(null, webResponse, popupPseudoWindow); setDomNode(popupPage); popupPseudoWindow.setEnclosedPage(popupPage); final HtmlHtml html = (HtmlHtml) HTMLParser.getFactory(HtmlHtml.TAG_NAME).createElement( popupPage, HtmlHtml.TAG_NAME, null); popupPage.appendChild(html); final HtmlBody body = (HtmlBody) HTMLParser.getFactory(HtmlBody.TAG_NAME).createElement( popupPage, HtmlBody.TAG_NAME, null); html.appendChild(body); document_.setDomNode(popupPage); }
void init(final Window openerJSWindow) { // build document document_ = new HTMLDocument(); document_.setPrototype(openerJSWindow.getPrototype(HTMLDocument.class)); document_.setParentScope(this); final WebWindow openerWindow = openerJSWindow.getWebWindow(); // create the "page" associated to the document final WebWindow popupPseudoWindow = new PopupPseudoWebWindow(openerWindow.getWebClient()); // take the WebResponse of the opener (not really correct, but...) final WebResponse webResponse = openerWindow.getEnclosedPage().getWebResponse(); final HtmlPage popupPage = new HtmlPage(null, webResponse, popupPseudoWindow); setDomNode(popupPage); popupPseudoWindow.setEnclosedPage(popupPage); final HtmlHtml html = (HtmlHtml) HTMLParser.getFactory(HtmlHtml.TAG_NAME).createElement( popupPage, HtmlHtml.TAG_NAME, null); popupPage.appendChild(html); final HtmlBody body = (HtmlBody) HTMLParser.getFactory(HtmlBody.TAG_NAME).createElement( popupPage, HtmlBody.TAG_NAME, null); html.appendChild(body); document_.setDomNode(popupPage); }
void init(final Window openerJSWindow) { // build document document_ = new HTMLDocument(); document_.setPrototype(openerJSWindow.getPrototype(HTMLDocument.class)); document_.setParentScope(this); final WebWindow openerWindow = openerJSWindow.getWebWindow(); // create the "page" associated to the document final WebWindow popupPseudoWindow = new PopupPseudoWebWindow(openerWindow.getWebClient()); // take the WebResponse of the opener (not really correct, but...) final WebResponse webResponse = openerWindow.getEnclosedPage().getWebResponse(); final HtmlPage popupPage = new HtmlPage(null, webResponse, popupPseudoWindow); setDomNode(popupPage); popupPseudoWindow.setEnclosedPage(popupPage); final HtmlHtml html = (HtmlHtml) HTMLParser.getFactory(HtmlHtml.TAG_NAME).createElement( popupPage, HtmlHtml.TAG_NAME, null); popupPage.appendChild(html); final HtmlBody body = (HtmlBody) HTMLParser.getFactory(HtmlBody.TAG_NAME).createElement( popupPage, HtmlBody.TAG_NAME, null); html.appendChild(body); document_.setDomNode(popupPage); }
page.appendChild(html.getDomNodeOrDie());
page.appendChild(html.getDomNodeOrDie());