Opened 5 years ago

Closed 5 years ago

#9988 closed bug (notabug)

Spinner: Unit tests failure in Firefox after mousewheel update

Reported by: Jörn Zaefferer Owned by:
Priority: minor Milestone: none
Component: ui.spinner Version: git (not yet released)
Keywords: Cc:
Blocked by: Blocking:

Description

This is a weird one. Since updating the mousewheel plugin, spinner unit tests have been failing in Firefox 27 and 28, for example this: http://swarm.jquery.org/result/1778279 (the test uses equal with wrong argument order, the correct result is "2").

Reverting that commit or removing the mousewheel plugin from the spinner test suite works around this issue - the test involving mousewheel doesn't actually need the mouswheel plugin.

I tried to figure out why this test is failing. I found that the problem disappears when removing these two lines (both were introduced with the plugin update): https://github.com/jquery/jquery-ui/blob/919d9185f2cf586f794b367a2570368fd81f3879/external/jquery.mousewheel.js#L46-47 Removing just one of them isn't enough - as long as one of these lines exists, the problem occurs.

Inside of these methods, calling $(elem).height() or $(elem).offsetParent() seems to be responsible. Calling .parent() works fine. I ran through the offsetParent call with the debugger and there's nothing suspicious happening. I still have no clue why or how that effects this spinner unit test where we only a cursor UP event and check the value.

I currently tend to just removing the mouswheel plugin from the spinner test suite. Before doing that I wanted to see if someone has an idea what might be going on here.

Change History (4)

comment:1 Changed 5 years ago by tj.vantoll

Status: newopen

I took a quick look at this and the behavior is just bizarre. It would be unfortunate to remove the mousewheel plugin's tests, but I can't think of a better idea.

comment:2 Changed 5 years ago by Scott González

I'm not sure why this is happening, but the simulated keydown event never gets dispatched. We successfully make it into dispatchEvent() in the simulate plugin, but even using addEventListener(), the event handler never runs. We should reduce this and submit a bug report against Firefox.

comment:3 Changed 5 years ago by Jörn Zaefferer

Spinner tests: Remove mousewheel plugin

The plugin isn't needed nor used in the unit tests, which just trigger the appropriate events. This works around the failure in Firefox 27/28 that we'll try to track down separately.

Ref #9988

Changeset: 192f51c9a25573208d531ff217d2144c237397b6

comment:4 Changed 5 years ago by Jörn Zaefferer

Resolution: notabug
Status: openclosed

Closing this since it doesn't affect anything in uI.

Note: See TracTickets for help on using tickets.