lewisje / svgweb

Automatically exported from code.google.com/p/svgweb
Other
0 stars 0 forks source link

Mouseout event not firing when setAttribute called during Mouseover (in Flash) (regression) #549

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Create text nodes with mouseover and mouseout event listeners via 
addEventListener (see included example source).
2. Have the mouseover implementation call setAttribute (e.g., setting a style) 
on the same element that has the event listeners.
3. Test in Flash and observe that often the mouseout event doesn't fire.
4. Remove the setAttribute call (from step 2), and re-test, and the mouseout 
event always fires.

What is the expected output? What do you see instead?

Both text elements should never be highlighted in red at the same time, but 
sometimes are (may take a bit of playing with in this example). In non-Flash 
native browser SVG this problem never occurs.

In my "real" code, the mouseout event fails to fire well over 90% of the time 
in Flash, but always works when setAttribute is removed. In the attached 
example, for some reason the failure rate is much lower (closer to 10% of the 
time).

What version of the product are you using? On what operating system,
browser, and version of Flash?

Owlephant, Windows 7, IE 8 or Firefox 3.6.8, Flash 10,1,82,76 or 10,1,53,64

Note that this problem never occurred in my real code with Gelatinous Cube, it 
only is an issue with Dracolisk and Owlephant.

Please provide any additional information below. Reduced test cases are
always appreciated!

Sample source attached with inline comments.

I have not yet come up with a workaround but would welcome suggestions.

Original issue reported on code.google.com by Bjorn...@gmail.com on 11 Sep 2010 at 3:42

Attachments:

GoogleCodeExporter commented 8 years ago
I should have noted that it's possible this issue is restricted to 
"setAttribute('style', VALUE)" calls during the mouseover event, as a similar 
"setAttribute('fill', VALUE)" always succeeds. And in my "real" project if I 
remove some extra SVG manipulation that occurs during mouseover, the mouseout 
is more likely to succeed (but still not 100%), so there may be some timing 
issue at work.

However, this exact same code gave 100% mouseout success in Gelatinous Cube 
using Flash, otherwise I would just assume I was doing something wrong.

If it helps I can upload some linkable copies of my "real" project that 
demonstrates the issue.

Original comment by Bjorn...@gmail.com on 13 Sep 2010 at 5:26

GoogleCodeExporter commented 8 years ago
This problem was tricky to isolate. It is a regression introduced in r1048.

In that revision, the design for text nodes changed. In the previous design, 
flash TextFields were reused when they needed to be redrawn. In the new design, 
new TextField(s) are created, the old one(s) is removed, then the new ones are 
added. The new design causes problems for mouse tracking.

I believe the new design could be reworked to reuse TextFields in order to 
solve this problem.

Original comment by grick23@gmail.com on 17 Sep 2010 at 4:49