final Page enclosedPage = currentWindow_.getEnclosedPage();
if (enclosedPage instanceof HtmlPage) {
final Window jsWindow = (Window) currentWindow_.getScriptObject();
if (jsWindow != null) {
if (getBrowserVersion().isIE()) {
final HTMLElement activeElement = (HTMLElement) jsWindow.jsxGet_document().jsxGet_activeElement();
if (activeElement != null) {
((HtmlPage) enclosedPage).setFocusedElement(activeElement.getDomNodeOrDie(), true);
}
}
else {
final HtmlElement focusedElement = ((HtmlPage) enclosedPage).getFocusedElement();
if (focusedElement != null) {