Skip to main content

Search and Top Navigation

#9988 closed bug (notabug)

Opened April 21, 2014 11:37AM UTC

Closed April 23, 2014 06:14PM UTC

Spinner: Unit tests failure in Firefox after mousewheel update

Reported by: jzaefferer 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.

Attachments (0)
Change History (4)

Changed April 21, 2014 12:25PM UTC by tj.vantoll comment:1

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.

Changed April 21, 2014 04:12PM UTC by scottgonzalez comment:2

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.

Changed April 23, 2014 06:03PM UTC by Jörn Zaefferer comment:3

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

Changed April 23, 2014 06:14PM UTC by jzaefferer comment:4

resolution: → notabug
status: openclosed

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