You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2020/10/25 00:34:09 UTC

[royale-asjs] 01/05: fix for: IE11 was not converting MouseEvents - fixes 'mouse coords from MouseEvents not consistent with other browsers, on IE11'.

This is an automated email from the ASF dual-hosted git repository.

gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 53dddc4c64c5c4194d1ba71cf4d5e82ba1cb9c3b
Author: greg-dove <gr...@gmail.com>
AuthorDate: Sun Oct 25 11:42:56 2020 +1300

    fix for: IE11 was not converting MouseEvents - fixes 'mouse coords from MouseEvents not consistent with other browsers, on IE11'.
---
 .../src/main/royale/org/apache/royale/core/ElementWrapper.as   | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
index 3bb85db..520f548 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
@@ -190,7 +190,15 @@ package org.apache.royale.core
 		{
             var e:IBrowserEvent;
             var nativeEvent:Object = eventObject.getBrowserEvent();
-            var converter:Function = converterMap[nativeEvent.constructor.name];
+            var nativeClassName:String = nativeEvent.constructor.name;
+            if (nativeClassName == null) {
+                //IE11 :
+                if (nativeEvent.constructor == window['MouseEvent'] || nativeEvent.constructor == window['PointerEvent']) {
+                    nativeEvent.constructor.name = 'MouseEvent';
+                    nativeClassName = 'MouseEvent';
+                }
+            }
+            var converter:Function = converterMap[nativeClassName];
             if (converter)
                 e = converter(nativeEvent,eventObject);
             else


Re: [royale-asjs] 01/05: fix for: IE11 was not converting MouseEvents - fixes 'mouse coords from MouseEvents not consistent with other browsers, on IE11'.

Posted by Greg Dove <gr...@gmail.com>.
Thanks, I had no idea this bead existed. I am actually an advocate for
removing IE11 support, but I had the impression we had 'advertised' it as
supported by default, not via opt-in.

This makes sense, I'll revert the change. But I suspect it will be
something that people using Royale won't easily figure out/find
by themselves, given that at least 2 of us did not seem to know about it.
One thing I discovered is that double click on IE11 appeared as a
PointerEvent and not a MouseEvent, so I will add that to the bead (and give
it the 'name' MouseEvent also (it's probably not 'good practice' but it's
only for IE11).




On Sun, Oct 25, 2020 at 11:47 PM Harbs <ha...@gmail.com> wrote:

> It can actually be added anywhere, but Application is probably to most
> logical place.
>
> > On Oct 25, 2020, at 1:42 PM, Carlos Rovira <ca...@apache.org>
> wrote:
> >
> > Interesting, how is this bead added? to main Application beads?
> >
> > El dom., 25 oct. 2020 a las 11:41, Harbs (<ha...@gmail.com>)
> escribió:
> >
> >> This doesn’t belong in ElementWrapper.
> >>
> >> There’s a IEEventAdapterBead which should be added to all apps which
> need
> >> to support IE mouse and keyboard events.
> >>
> >>
> >>> On Oct 25, 2020, at 3:34 AM, gregdove@apache.org wrote:
> >>>
> >>> This is an automated email from the ASF dual-hosted git repository.
> >>>
> >>> gregdove pushed a commit to branch develop
> >>> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
> >>>
> >>> commit 53dddc4c64c5c4194d1ba71cf4d5e82ba1cb9c3b
> >>> Author: greg-dove <gr...@gmail.com>
> >>> AuthorDate: Sun Oct 25 11:42:56 2020 +1300
> >>>
> >>>   fix for: IE11 was not converting MouseEvents - fixes 'mouse coords
> >> from MouseEvents not consistent with other browsers, on IE11'.
> >>> ---
> >>> .../src/main/royale/org/apache/royale/core/ElementWrapper.as   | 10
> >> +++++++++-
> >>> 1 file changed, 9 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git
> >>
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
> >>
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
> >>> index 3bb85db..520f548 100644
> >>> ---
> >>
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
> >>> +++
> >>
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
> >>> @@ -190,7 +190,15 @@ package org.apache.royale.core
> >>>              {
> >>>            var e:IBrowserEvent;
> >>>            var nativeEvent:Object = eventObject.getBrowserEvent();
> >>> -            var converter:Function = converterMap[
> >> nativeEvent.constructor.name];
> >>> +            var nativeClassName:String = nativeEvent.constructor.name
> ;
> >>> +            if (nativeClassName == null) {
> >>> +                //IE11 :
> >>> +                if (nativeEvent.constructor == window['MouseEvent'] ||
> >> nativeEvent.constructor == window['PointerEvent']) {
> >>> +                    nativeEvent.constructor.name = 'MouseEvent';
> >>> +                    nativeClassName = 'MouseEvent';
> >>> +                }
> >>> +            }
> >>> +            var converter:Function = converterMap[nativeClassName];
> >>>            if (converter)
> >>>                e = converter(nativeEvent,eventObject);
> >>>            else
> >>>
> >>
> >>
> >
> > --
> > Carlos Rovira
> > Apache Member & Apache Royale PMC
> > *Apache Software Foundation*
> > http://about.me/carlosrovira
>
>

Re: [royale-asjs] 01/05: fix for: IE11 was not converting MouseEvents - fixes 'mouse coords from MouseEvents not consistent with other browsers, on IE11'.

Posted by Harbs <ha...@gmail.com>.
It can actually be added anywhere, but Application is probably to most logical place.

> On Oct 25, 2020, at 1:42 PM, Carlos Rovira <ca...@apache.org> wrote:
> 
> Interesting, how is this bead added? to main Application beads?
> 
> El dom., 25 oct. 2020 a las 11:41, Harbs (<ha...@gmail.com>) escribió:
> 
>> This doesn’t belong in ElementWrapper.
>> 
>> There’s a IEEventAdapterBead which should be added to all apps which need
>> to support IE mouse and keyboard events.
>> 
>> 
>>> On Oct 25, 2020, at 3:34 AM, gregdove@apache.org wrote:
>>> 
>>> This is an automated email from the ASF dual-hosted git repository.
>>> 
>>> gregdove pushed a commit to branch develop
>>> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
>>> 
>>> commit 53dddc4c64c5c4194d1ba71cf4d5e82ba1cb9c3b
>>> Author: greg-dove <gr...@gmail.com>
>>> AuthorDate: Sun Oct 25 11:42:56 2020 +1300
>>> 
>>>   fix for: IE11 was not converting MouseEvents - fixes 'mouse coords
>> from MouseEvents not consistent with other browsers, on IE11'.
>>> ---
>>> .../src/main/royale/org/apache/royale/core/ElementWrapper.as   | 10
>> +++++++++-
>>> 1 file changed, 9 insertions(+), 1 deletion(-)
>>> 
>>> diff --git
>> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
>> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
>>> index 3bb85db..520f548 100644
>>> ---
>> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
>>> +++
>> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
>>> @@ -190,7 +190,15 @@ package org.apache.royale.core
>>>              {
>>>            var e:IBrowserEvent;
>>>            var nativeEvent:Object = eventObject.getBrowserEvent();
>>> -            var converter:Function = converterMap[
>> nativeEvent.constructor.name];
>>> +            var nativeClassName:String = nativeEvent.constructor.name;
>>> +            if (nativeClassName == null) {
>>> +                //IE11 :
>>> +                if (nativeEvent.constructor == window['MouseEvent'] ||
>> nativeEvent.constructor == window['PointerEvent']) {
>>> +                    nativeEvent.constructor.name = 'MouseEvent';
>>> +                    nativeClassName = 'MouseEvent';
>>> +                }
>>> +            }
>>> +            var converter:Function = converterMap[nativeClassName];
>>>            if (converter)
>>>                e = converter(nativeEvent,eventObject);
>>>            else
>>> 
>> 
>> 
> 
> -- 
> Carlos Rovira
> Apache Member & Apache Royale PMC
> *Apache Software Foundation*
> http://about.me/carlosrovira


Re: [royale-asjs] 01/05: fix for: IE11 was not converting MouseEvents - fixes 'mouse coords from MouseEvents not consistent with other browsers, on IE11'.

Posted by Carlos Rovira <ca...@apache.org>.
Interesting, how is this bead added? to main Application beads?

El dom., 25 oct. 2020 a las 11:41, Harbs (<ha...@gmail.com>) escribió:

> This doesn’t belong in ElementWrapper.
>
> There’s a IEEventAdapterBead which should be added to all apps which need
> to support IE mouse and keyboard events.
>
>
> > On Oct 25, 2020, at 3:34 AM, gregdove@apache.org wrote:
> >
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > gregdove pushed a commit to branch develop
> > in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
> >
> > commit 53dddc4c64c5c4194d1ba71cf4d5e82ba1cb9c3b
> > Author: greg-dove <gr...@gmail.com>
> > AuthorDate: Sun Oct 25 11:42:56 2020 +1300
> >
> >    fix for: IE11 was not converting MouseEvents - fixes 'mouse coords
> from MouseEvents not consistent with other browsers, on IE11'.
> > ---
> > .../src/main/royale/org/apache/royale/core/ElementWrapper.as   | 10
> +++++++++-
> > 1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > diff --git
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
> > index 3bb85db..520f548 100644
> > ---
> a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
> > +++
> b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
> > @@ -190,7 +190,15 @@ package org.apache.royale.core
> >               {
> >             var e:IBrowserEvent;
> >             var nativeEvent:Object = eventObject.getBrowserEvent();
> > -            var converter:Function = converterMap[
> nativeEvent.constructor.name];
> > +            var nativeClassName:String = nativeEvent.constructor.name;
> > +            if (nativeClassName == null) {
> > +                //IE11 :
> > +                if (nativeEvent.constructor == window['MouseEvent'] ||
> nativeEvent.constructor == window['PointerEvent']) {
> > +                    nativeEvent.constructor.name = 'MouseEvent';
> > +                    nativeClassName = 'MouseEvent';
> > +                }
> > +            }
> > +            var converter:Function = converterMap[nativeClassName];
> >             if (converter)
> >                 e = converter(nativeEvent,eventObject);
> >             else
> >
>
>

-- 
Carlos Rovira
Apache Member & Apache Royale PMC
*Apache Software Foundation*
http://about.me/carlosrovira

Re: [royale-asjs] 01/05: fix for: IE11 was not converting MouseEvents - fixes 'mouse coords from MouseEvents not consistent with other browsers, on IE11'.

Posted by Harbs <ha...@gmail.com>.
This doesn’t belong in ElementWrapper.

There’s a IEEventAdapterBead which should be added to all apps which need to support IE mouse and keyboard events.


> On Oct 25, 2020, at 3:34 AM, gregdove@apache.org wrote:
> 
> This is an automated email from the ASF dual-hosted git repository.
> 
> gregdove pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
> 
> commit 53dddc4c64c5c4194d1ba71cf4d5e82ba1cb9c3b
> Author: greg-dove <gr...@gmail.com>
> AuthorDate: Sun Oct 25 11:42:56 2020 +1300
> 
>    fix for: IE11 was not converting MouseEvents - fixes 'mouse coords from MouseEvents not consistent with other browsers, on IE11'.
> ---
> .../src/main/royale/org/apache/royale/core/ElementWrapper.as   | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
> index 3bb85db..520f548 100644
> --- a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
> +++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/ElementWrapper.as
> @@ -190,7 +190,15 @@ package org.apache.royale.core
> 		{
>             var e:IBrowserEvent;
>             var nativeEvent:Object = eventObject.getBrowserEvent();
> -            var converter:Function = converterMap[nativeEvent.constructor.name];
> +            var nativeClassName:String = nativeEvent.constructor.name;
> +            if (nativeClassName == null) {
> +                //IE11 :
> +                if (nativeEvent.constructor == window['MouseEvent'] || nativeEvent.constructor == window['PointerEvent']) {
> +                    nativeEvent.constructor.name = 'MouseEvent';
> +                    nativeClassName = 'MouseEvent';
> +                }
> +            }
> +            var converter:Function = converterMap[nativeClassName];
>             if (converter)
>                 e = converter(nativeEvent,eventObject);
>             else
>