HTMLIFrameElement frame = (HTMLIFrameElement) DomGlobal.document.createElement("iframe");
HTMLDocument doc = (HTMLDocument) frame.contentDocument; //throws java.lang.ClassCastException
private static native HTMLDocument getHtmlDocument(HTMLIFrameElement frame) /*-{
return frame.contentDocument;
}-*/;