I've been struggling hard today tracking down the origin of a problem we have with Firefox 3.6 (the hard part being that the perceived problem was involving some quite complex mechanism including synchronous/asynchronous dispatching and actionscript/javascript boundary crossing).

Ultimately, I narrowed it down to a relatively simple test case.

  1. Have a very simple swf application, that listens to *flash* mouse events (over, out down, up, click, move)
  2. Launch in Firefox 3.5 (I'm on mac). Click on the swf app. Here's what you get back:
mouseDown [MouseEvent type="mouseDown" bubbles=true cancelable=false eventPhase=2 localX=279 localY=64 stageX=279 stageY=64 relatedObject=null ctrlKey=false altKey=false shiftKey=false buttonDown=true delta=0]

mouseUp [MouseEvent type="mouseUp" bubbles=true cancelable=false eventPhase=2 localX=279 localY=64 stageX=279 stageY=64 relatedObject=null ctrlKey=false altKey=false shiftKey=false buttonDown=false delta=0]

click [MouseEvent type="click" bubbles=true cancelable=false eventPhase=2 localX=279 localY=64 stageX=279 stageY=64 relatedObject=null ctrlKey=false altKey=false shiftKey=false buttonDown=false delta=0]


That's expected, normal.

Now, same swf application, same flash version, same html page. Launch in Firefox 3.6. Here is what you get back.

mouseDown [MouseEvent type="mouseDown" bubbles=true cancelable=false eventPhase=2 localX=309 localY=69 stageX=309 stageY=69 relatedObject=null ctrlKey=false altKey=false shiftKey=false buttonDown=true delta=0]

mouseUp [MouseEvent type="mouseUp" bubbles=true cancelable=false eventPhase=2 localX=309 localY=69 stageX=309 stageY=69 relatedObject=null ctrlKey=false altKey=false shiftKey=false buttonDown=false delta=0]

click [MouseEvent type="click" bubbles=true cancelable=false eventPhase=2 localX=309 localY=69 stageX=309 stageY=69 relatedObject=null ctrlKey=false altKey=false shiftKey=false buttonDown=false delta=0]

mouseOut [MouseEvent type="mouseOut" bubbles=true cancelable=false eventPhase=2 localX=-1 localY=-1 stageX=-1 stageY=-1 relatedObject=null ctrlKey=false altKey=false shiftKey=false buttonDown=false delta=0]

Noticed the extra mouseOut event? Along with the odd stageX localX coordinates? Right now I have no idea if either a change in 3.6 revealed an old bug in Flash, or if 3.6 is at fault, but it's obvious that something did change in 3.6, likely in nsplugin.

While I would certainly be glad to report the bug to either/both Adobe or/and Mozilla, I would first love to learn more (if someone has the info) about what exactly changed in Gecko regarding these areas (plugin + event) that could relate to this, in order to report the problem to the most appropriate place with the most accurate description.

Clues?

[Update]

The description above is only one (specific) manifestation of the problem.

Actually, most time, what you get is:

click [MouseEvent type="click" bubbles=true cancelable=false eventPhase=2 localX=184 localY=46 stageX=184 stageY=46 relatedObject=null ctrlKey=false altKey=false shiftKey=false buttonDown=false delta=0]

mouseMove [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=2 localX=184 localY=24 stageX=184 stageY=24 relatedObject=null ctrlKey=false altKey=false shiftKey=false buttonDown=false delta=0]

mouseMove [MouseEvent type="mouseMove" bubbles=true cancelable=false eventPhase=2 localX=184 localY=46 stageX=184 stageY=46 relatedObject=null ctrlKey=false altKey=false shiftKey=false buttonDown=false delta=0]

Look at the stageX/Y coordinates.

You get correct coordinates for the click, then extremely quickly, a bogus update of the position (offset by -22 on Y <- and this is always 22), then immediately a new (correct) update of the cursor position.

We obviously don't speak about DOM events here, given plugins handle events themselves (or are supposed to).

So, my lecture tend to become now: "doing a click on a swf node causes firefox 3.6 to temporarily alter the cursor position by -22". I'm clueless about the meaning of "22" (it's not 42 :-)) - graphic cursor size?

Maybe after all this has nothing to do with nsplugin...

[Update 2]

Haha! It's not "22", it's exactly the value of window.screenY, and the same is true for screenX.

So, let's reformulate one last time:

"When you do click on a swf node in firefox 3.6, flash then successively receive a notification that the mouse has moved from its previous position (x, y), to (x - window.screenX, y - window.screenY), and immediately after, back to (x, y)".