The browser does not support RollOver/RollOut so we are running code to
emulate it, so wouldn't worry about the performance.  The browser's
implementation is likely faster than our JS implementation.    Back when I
wrote this code, it wasn't clear that we could use mouseEnter/mouseLeave.
If folks agree that we can, then we can save a some code.

If we decide to use mouseEnter/mouseLeave we also need to decide whether
to stick with the Flex names of rollOver/rollOut or go with
mouseEnter/mouseLeave.  Already, all mouse events have different
capitalization of the event name (mouseDown vs mousedown) so folks "must"
use the event constants and not quoted strings in their code.

But it definitely sounds like this change is "just-in-case" code.  When
writing framework code, especially for FlexJS, we need to not just fix
whatever problem you are working on, but also consider the impact on all
other users of the framework code.  When writing application code, I'm
also prone to writing the quick fix if I'm not concerned about code
re-use.  But in framework code, we are "always" concerned about code
re-use.  We have to fix the right problem.  I'm thinking the actual
problem is that the tooltip is a live mouse target.  The right fix might
just be to make sure the tooltips are "transparent" to the mouse.

Thoughts?
-Alex

On 7/11/17, 1:02 AM, "Harbs" <harbs.li...@gmail.com> wrote:

>I can’t make up my mind… ;-)
>
>I’m not sure why the MDN article says the mouseenter can have more CPU
>problems. It seems like mouseover should be dispatched more because it
>bubbles up from all sub-elements.[2] It seems like mouseover is identical
>to mouseOver in Flash and mouseenter is identical to rollOver.
>
>That should mean that mouseenter should be the better option.
>
>[2]https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.qu
>irksmode.org%2Fjs%2Fevents_mouse.html&data=02%7C01%7C%7C0aa7240c28324ace7a
>9008d4c8341bfb%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C63635357351272
>7427&sdata=ypCqQo8z6cbX01npatvfaWF6cW347gOjdhtgpfqIiiw%3D&reserved=0
><https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.quir
>ksmode.org%2Fjs%2Fevents_mouse.html&data=02%7C01%7C%7C0aa7240c28324ace7a90
>08d4c8341bfb%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6363535735127274
>27&sdata=ypCqQo8z6cbX01npatvfaWF6cW347gOjdhtgpfqIiiw%3D&reserved=0>
>
>> On Jul 11, 2017, at 10:48 AM, Harbs <harbs.li...@gmail.com> wrote:
>> 
>> No. I’m wrong.
>> 
>> First of all, it’s mouseenter rather than rollover, and it seems like
>>it’s fired more than mouseover.[1]
>> 
>>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdevelope
>>r.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FEvents%2Fmouseenter&data=02%7C01%7C%
>>7C0aa7240c28324ace7a9008d4c8341bfb%7Cfa7b1b5a7b34438794aed2c178decee1%7C0
>>%7C0%7C636353573512727427&sdata=PUExzeCEz0B6iWscUPz7WpebnTvI%2BNHL9VwSdUO
>>7fKU%3D&reserved=0
>><https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdevelop
>>er.mozilla.org%2Fen-US%2Fdocs%2FWeb%2FEvents%2Fmouseenter&data=02%7C01%7C
>>%7C0aa7240c28324ace7a9008d4c8341bfb%7Cfa7b1b5a7b34438794aed2c178decee1%7C
>>0%7C0%7C636353573512727427&sdata=PUExzeCEz0B6iWscUPz7WpebnTvI%2BNHL9VwSdU
>>O7fKU%3D&reserved=0>
>> 
>> That does beg the question though: Are the MouseEvent constants wrong
>>for Javascript?
>> 
>> 
>>> On Jul 11, 2017, at 10:38 AM, Harbs <harbs.li...@gmail.com
>>><mailto:harbs.li...@gmail.com>> wrote:
>>> 
>>> Shouldn’t the event be triggered by rollover rather than mouseover?
>>> 
>>> That seems like the issue to me…
>>> 
>>>> On Jul 11, 2017, at 10:13 AM, Alex Harui <aha...@adobe.com
>>>><mailto:aha...@adobe.com>> wrote:
>>>> 
>>>> This seems like "just-in-case" code.  I could see that it might be
>>>>needed
>>>> in a different bead for Express though.
>>>> 
>>>> Without this change, is there an infinite loop somewhere?
>>>> 
>>>> Thanks,
>>>> -Alex
>>>> 
>>>> On 7/10/17, 10:40 PM, "jmcl...@apache.org
>>>><mailto:jmcl...@apache.org>" <jmcl...@apache.org
>>>><mailto:jmcl...@apache.org>> wrote:
>>>> 
>>>>> FLEX-35338 stop cursor from spinning / CPU from spiking
>>>>> 
>>>>> 
>>>>> Project: 
>>>>> 
>>>>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wi
>>>>>p-us 
>>>>><https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-w
>>>>>ip-us>
>>>>> 
>>>>>.apache.org%2Frepos%2Fasf%2Fflex-asjs%2Frepo&data=02%7C01%7C%7C8e2e2d5
>>>>>b3b3
>>>>> 
>>>>>54f54848508d4c81f5768%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636
>>>>>3534
>>>>> 
>>>>>84318029070&sdata=32hEJB%2BTNsWKG8MY%2FdPr3d0RWT5Xr1tECWWpVTlM270%3D&r
>>>>>eser
>>>>> ved=0
>>>>> Commit: 
>>>>> 
>>>>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wi
>>>>>p-us
>>>>> 
>>>>>.apache.org%2Frepos%2Fasf%2Fflex-asjs%2Fcommit%2F549a10d8&data=02%7C01
>>>>>%7C%
>>>>> 
>>>>>7C8e2e2d5b3b354f54848508d4c81f5768%7Cfa7b1b5a7b34438794aed2c178decee1%
>>>>>7C0%
>>>>> 
>>>>>7C0%7C636353484318029070&sdata=dcNhAGu8WspafZBZCRxb%2FN0z7D%2Fym3tuv%2
>>>>>BAaq
>>>>> G280z0%3D&reserved=0
>>>>> Tree: 
>>>>> 
>>>>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wi
>>>>>p-us
>>>>> 
>>>>>.apache.org%2Frepos%2Fasf%2Fflex-asjs%2Ftree%2F549a10d8&data=02%7C01%7
>>>>>C%7C
>>>>> 
>>>>>8e2e2d5b3b354f54848508d4c81f5768%7Cfa7b1b5a7b34438794aed2c178decee1%7C
>>>>>0%7C
>>>>> 
>>>>>0%7C636353484318029070&sdata=0p89CGQLSv0Pp0yscOBNjKRJ1HUMhHrDngm4xxixa
>>>>>lc%3
>>>>> D&reserved=0
>>>>> Diff: 
>>>>> 
>>>>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wi
>>>>>p-us
>>>>> 
>>>>>.apache.org%2Frepos%2Fasf%2Fflex-asjs%2Fdiff%2F549a10d8&data=02%7C01%7
>>>>>C%7C
>>>>> 
>>>>>8e2e2d5b3b354f54848508d4c81f5768%7Cfa7b1b5a7b34438794aed2c178decee1%7C
>>>>>0%7C
>>>>> 
>>>>>0%7C636353484318029070&sdata=%2FclUp4scfr0z%2B%2FTPjBMlVw2kScADTcLPMwo
>>>>>p5J4
>>>>> 7cIU%3D&reserved=0
>>>>> 
>>>>> Branch: refs/heads/develop
>>>>> Commit: 549a10d82da5835c61a2b1247b65f7bfbc2f9a36
>>>>> Parents: 3891820
>>>>> Author: Justin Mclean <jmcl...@apache.org>
>>>>> Authored: Tue Jul 11 14:57:04 2017 +1000
>>>>> Committer: Justin Mclean <jmcl...@apache.org>
>>>>> Committed: Tue Jul 11 14:57:04 2017 +1000
>>>>> 
>>>>> 
>>>>>----------------------------------------------------------------------
>>>>> .../main/flex/org/apache/flex/html/accessories/ToolTipBead.as   | 5
>>>>>++++-
>>>>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>>>> 
>>>>>----------------------------------------------------------------------
>>>>> 
>>>>> 
>>>>> 
>>>>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wi
>>>>>p-us
>>>>> 
>>>>>.apache.org%2Frepos%2Fasf%2Fflex-asjs%2Fblob%2F549a10d8%2Fframeworks%2
>>>>>Fpro
>>>>> 
>>>>>jects%2FBasic%2Fsrc%2Fmain%2Fflex%2Forg%2Fapache%2Fflex%2Fhtml%2Facces
>>>>>sori
>>>>> 
>>>>>es%2FToolTipBead.as&data=02%7C01%7C%7C8e2e2d5b3b354f54848508d4c81f5768
>>>>>%7Cf
>>>>> 
>>>>>a7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636353484318029070&sdata=hif
>>>>>p5T8
>>>>> xFlL4zov22P5qOUYtZqrYuPqTqOJg2x4X5lo%3D&reserved=0
>>>>> 
>>>>>----------------------------------------------------------------------
>>>>> diff --git 
>>>>> 
>>>>>a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/accesso
>>>>>ries
>>>>> /ToolTipBead.as
>>>>> 
>>>>>b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/accesso
>>>>>ries
>>>>> /ToolTipBead.as
>>>>> index 03ce21e..bdf0b68 100644
>>>>> --- 
>>>>> 
>>>>>a/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/accesso
>>>>>ries
>>>>> /ToolTipBead.as
>>>>> +++ 
>>>>> 
>>>>>b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/accesso
>>>>>ries
>>>>> /ToolTipBead.as
>>>>> @@ -100,7 +100,10 @@ package org.apache.flex.html.accessories
>>>>>            * @private
>>>>>            */
>>>>>           protected function rollOverHandler( event:MouseEvent ):void
>>>>> -         {       
>>>>> +         {
>>>>> +                 if (!toolTip)
>>>>> +                         return;
>>>>> +
>>>>> 
>>>>> IEventDispatcher(_strand).addEventListener(MouseEvent.MOUSE_OUT,
>>>>> rollOutHandler, false);
>>>>> 
>>>>>           var comp:IUIBase = _strand as IUIBase
>>>>> 
>>>> 
>>> 
>> 
>

Reply via email to