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);