The way to work around it is to use a native method:

private static native HTMLDocument getHtmlDocument(HTMLIFrameElement frame) 
/*-{
    return frame.contentDocument;
}-*/;

Is this required?

On Wednesday, May 31, 2017 at 8:23:20 AM UTC+2, Daniel Harezlak wrote:
>
> Hi, I have the following code using elemental2-dom:
>
> HTMLIFrameElement frame = (HTMLIFrameElement) DomGlobal.document.
> createElement("iframe");
> HTMLDocument doc = (HTMLDocument) frame.contentDocument; //throws 
> java.lang.ClassCastException
>
> The second line throws an exception although I am quite sure that the 
> returned element is an HTMLDocument because when I log it in the JS 
> console I get "[object HTMLDocument]". The first line works fine. What is 
> strange the exception is only thrown in Chrome both in SDM and production 
> modes. In Firefox it works just fine. Any thoughts?
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/a2ffeb54-25fe-446d-af11-47aee2a9e4d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to