Hi Carlos, That is actually not related to what prompted me to look at this. That iOS issue could perhaps be related to the the way that rollover/rollout events are being supported in royale (see: [1]), but I am not sure.
What prompted me to take a look the code was the result of trying to use the dev tools in IE11. For some reason it was always breaking inside the original try/catch for the createMouseEvent, even though I don't see an option in the dev tools to 'break on caught errors', which is usually an 'extra' choice in other browsers' tools. Aside from seeking to avoid that issue, looking at the code made me question whether it could be optimised to avoid the try/catch for every call, and I found other small things that seemed like they could be improved also. There is the possibility to optimise further by actually swapping between two methods and avoiding conditional branching (see: [2]) completely, but this would mean either a) having the method being called typed as a public static var of type Function and having one of two assigned values - which loses the method signatures for any external use of that 'method' or b) using a hacky javascript approach to 'override'/patch the original method at runtime for older browsers (I think 'older browsers' might be a synonym for 'IE11', now). Maybe this second option could be used, but I don't think we are doing that type of thing elsewhere so I held back from that. 1. https://github.com/apache/royale-asjs/blob/c413972fb128a6b6d39139c50a10caa9d7d11d97/frameworks/projects/Core/src/main/royale/org/apache/royale/events/MouseEvent.as#L638 2. https://github.com/apache/royale-asjs/blob/c413972fb128a6b6d39139c50a10caa9d7d11d97/frameworks/projects/Core/src/main/royale/org/apache/royale/events/MouseEvent.as#L798 On Wed, Apr 10, 2019 at 8:44 PM Carlos Rovira <[email protected]> wrote: > Hi Greg, > > don't know if is related to this, but a problem I found with MoudseEvents > was on iOS Safari and Chrome, using a MouseEvent.MOUSE_OVER. > makes the user have to make an additional touch to trigger click on > buttons. For this reason in Jewel ToolTip I had to avoid mouse over for iOS > with this: > > if(OSUtils.getOS() != OSUtils.IOS_OS) > { > IEventDispatcher(_strand).addEventListener(MouseEvent.MOUSE_OVER, > rollOverHandler, false); > } > > maybe is not a problem with iOS as I thought but a problem with royale, and > is related to the issues you're describing here. Makes sense? > > thanks > > > > El mié., 10 abr. 2019 a las 1:32, Greg Dove (<[email protected]>) > escribió: > > > I just made a change in the javascript MouseEvent support, which avoids a > > try/catch on every 'createMouseEvent', and also avoids a dependency on > > MouseEventInit 'converter' class and an associated Language.as coercion. > I > > believe this should speed things up slightly for that code. > > > > One thing I observed, and I wanted to check on... > > for > > @royaleignorecoercion window.MouseEventInit > > the 'window' part is not present when the compiler is checking against > the > > window.MouseEventInit type in the AsIsEmitter. > > > > so: @royaleignorecoercion window.MouseEventInit does not work > > but: @royaleignorecoercion MouseEventInit does work > > > > for ignoring coercion on : > > params as window.MouseEventInit > > > > Is the above as intended/correct ? > > I made a change in the code that gets this to work - it was not > previously > > working to avoid the coercion in the framework MouseEventInit 'converter' > > class (which I think is now no longer needed, unless it is useful for > some > > non-framework use) > > > > > -- > Carlos Rovira > http://about.me/carlosrovira >
