About the iframe instanceof problem, I think this is due to the fact that JavaScript prototypes do not cross frame boundaries (for security and privacy reasons). So even in JavaScript, the instanceof operator would not work.
You can try this example :
If the HTMLDocument class would have @JsType( isNative=true, namespace=JsPackage.GLOBAL, name="Object" ) annotation, the above snippet would have worked as expected.
The suggested work around (jsni method) might work, the idea is to bypass the GWT compiler generated cast checks.
Thanks
Arnaud
- Elemental2 1.0.0-beta-1 and casting behaves unexpectedly - 3 Updates
- Elemental2 source code on github - 2 Updates
Daniel Harezlak <dhar...@gmail.com>: May 30 11:23PM -0700
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?
Daniel Harezlak <dhar...@gmail.com>: May 31 12:25AM -0700
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:
gwtt...@gmail.com: May 31 02:19AM -0700
How about using jsinterop.base.Js.cast() for the casing instead? - see:
https://groups.google.com/forum/#!topic/Google-Web-Toolkit/0XGv7EhDFmc
On Wednesday, May 31, 2017 at 7:23:20 AM UTC+1, Daniel Harezlak wrote:
Daniel Harezlak <dhar...@gmail.com>: May 30 11:04PM -0700
Hi, it looks like issues are disabled for the
https://github.com/google/elemental2 project.
On Saturday, May 20, 2017 at 12:34:09 AM UTC+2, Julien Dramaix wrote:
Julien Dramaix <julien....@gmail.com>: May 31 06:40AM
I've enabled the issue tab.
On Tue, May 30, 2017 at 11:04 PM Daniel Harezlak <dhar...@gmail.com>
wrote:
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to google-web-toolkit-co...@googlegroups.com.