Re: elemental2: Document.createEvent ?

2019-08-14 Thread Vassilis Virvilis
Jens, Thanks for reminding me. I have totally forgot this section. I believe that the document was written before Js.cast and Js.unchecked cast. Maybe some use cases and some examples would be helpful. Thanks again. On Wed, Aug 14, 2019 at 9:58 AM Jens wrote: > > >> It would be great if

Re: elemental2: Document.createEvent ?

2019-08-14 Thread Jens
> It would be great if there was some documentation that could compare > and spell the differences between > standard cast (), Js.cast(), Js.uncheckedCast() in various use cases > so we could have a list of dos and donts. > There is a whole section about instanceof/cast in

Re: elemental2: Document.createEvent ?

2019-08-13 Thread Vassilis Virvilis
It would be great if there was some documentation that could compare and spell the differences between standard cast (), Js.cast(), Js.uncheckedCast() in various use cases so we could have a list of dos and donts. Vassilis On Mon, Aug 12, 2019 at 4:27 PM Jens wrote: > > >> final

Re: elemental2: Document.createEvent ?

2019-08-12 Thread Jens
> final MyHTMLDocument doc = Js.cast(DomGlobal.document); <-- this crashes > final MyHTMLDocument doc = Js.uncheckedCast(DomGlobal.document); <-- this > works > Because the native browser document isn't a MyHTMLDocument? You can only treat it like a MyHTMLDocument by doing a nasty

Re: elemental2: Document.createEvent ?

2019-08-12 Thread Vassilis Virvilis
Hi again, I did create a class MyHTMLDocument that extends HTMLDocument. However final MyHTMLDocument doc = Js.cast(DomGlobal.document); <-- this crashes final MyHTMLDocument doc = Js.uncheckedCast(DomGlobal.document); <-- this works any idea why uncheckedCast is required? Thanks

Re: elemental2: Document.createEvent ?

2019-08-11 Thread Vassilis Virvilis
Hi Peter, Thanks for replying and for pointing me to the github issue. I am thinking the following strategy. Create a MyHTMLDocument that extends HTMLDocument and it has the execCommand but without the @Override annotations. That way when HTMLDocument gets execDocument implemented I will get a

Re: elemental2: Document.createEvent ?

2019-08-10 Thread Peter Donald
execCommand is not yet part of elemental2. There is no reason why it should not be other than the externs need cleaning up. It is on my list of things to do some time but we don't use it so I haven't got off my kaboose to do the work. The issue that is tracking this (among other things) is

Re: elemental2: Document.createEvent ?

2019-08-09 Thread Vassilis Virvilis
What about Document.execCommand() ? On Fri, Aug 9, 2019 at 5:20 PM Vassilis Virvilis wrote: > > Hi, > > I am looking for Document.createEvent and I can see that createEvent > is defined in DocumentEvent which is an interface but Document itself > does not inherit/implement this interface. > >

elemental2: Document.createEvent ?

2019-08-09 Thread Vassilis Virvilis
Hi, I am looking for Document.createEvent and I can see that createEvent is defined in DocumentEvent which is an interface but Document itself does not inherit/implement this interface. I suppose I can cast Document it to DocumentEvent with Js.cast() but that's ugly. So what's going on? I am