Commit Graph

179 Commits

Author SHA1 Message Date
Oleg Gaidarenko
6d43dc4233 Effects: stabilize rAF logic & align timeout logic with it
rAF logic was introduced almost three years ago relative to this commit,
as a primary method for scheduling animation (see gh-1578 pull).

With it there was two substantial changes - one was explicitly mentioned
and the other was not.

First, if browser window was hidden aka `document.hidden === true`
it would immediately execute all scheduled animation without waiting
for time pass i.e. tick time become `0` instead of 13 ms of a default value.

Which created possibility for circular executions in case if `complete`
method executed the same animation (see gh-3434 issue).

And the second one - since then there was two ways of scheduling animation:
with `setInterval` and `requestAnimationFrame`, but there was a
difference in their execution.

In case of `setInterval` it waited default `jQuery.fx.interval` value before
actually starting the new tick, not counting the first step which wasn't
set to be executed through tick method (aka `jQuery.fx.tick`).

Whereas `requestAnimationFrame` first scheduled the call and executed
the `step` method right after that, counting the first call of
`jQuery.fx.timer`, `tick` was happening twice in one frame.

But since tests explicitly disabled rAF method i.e.
`requestAnimationFrame = null` and checking only `setInterval` logic,
since it's impossible to do it otherwise - we missed that change.

Faulty logic also was presented with `cancelAnimationFrame`, which couldn't
clear any timers since `raf` scheduler didn't define new `timerId` value.

Because that change was so subtle, apparently no user noticed it proving
that both `cancelAnimationFrame` and `clearInterval` code paths are redundant.

Since `cancelAnimationFrame` didn't work properly and rAF is and was a primary
used code path, plus the same approach is used in other popular animation libs.

Therefore those code paths were removed.

These changes also replace two different functions which schedule the animation
with one, which checks what type of logic should be used and executes it
appropriatley, but for secondary path it now uses `setTimeout` making it more
consistent with rAF path.

Since ticks are happening globally we also don't require to listen
`visibilitychange` event.

It also changes the way how first call is scheduled so execution of
animation will not happen twice in one frame.

No new tests were not introduced, since now `setTimeout` logic should be
equivalent to the rAF one, but one test was changed since now we actually
execute animation at the first tick.

Fixes gh-3434
Closes gh-3559
2017-03-06 19:17:14 +01:00
Richard Gibson
3c89329cb2 Effects: Resolve issues revealed by recent Callbacks fix
Notify full progress before resolving empty animations
Register animation callbacks before their ticker
Remove the right timer when immediately-done animations spawn more

Ref 9d822bc1c1
Fixes gh-3502
Fixes gh-3503
Closes gh-3496
2017-01-16 10:18:49 -08:00
Oleg Gaidarenko
58c6ca9822 Build: ESLint details
Use eslint pragmas, fix new errors, etc

Closes gh-3148
2016-06-11 10:41:33 +03:00
Richard Gibson
356a3bccb0 Deferred: Separate the two paths in jQuery.when
Single- and no-argument calls act like Promise.resolve.
Multi-argument calls act like Promise.all.

Fixes gh-3029
Closes gh-3059
2016-05-02 12:30:31 -04:00
Richard Gibson
755e7ccf01 CSS: Toggle detached elements as visible unless they have display: none
Fixes gh-2863
Closes gh-3037
2016-04-11 13:21:11 -04:00
Oleg Gaidarenko
c158f5761a Tests: do not run IE9 effect tests if inside testswarm
That test doesn't work properly in such environment

Ref e04e246552
Fixes gh-2888
Closes gh-3034
2016-04-04 21:58:33 +03:00
Michał Gołębiowski
622db29d9c Docs:Tests: Remove legacy code & add support comments where needed
This commits backports some changes done in the patch to the then-existing
compat branch that removed support for old browsers and added some support
comments.

Refs 90d7cc1d8b
2016-03-30 11:21:36 +02:00
Michał Gołębiowski
9b086888b8 Docs:Tests: Remove obsolete code from tests, update support comments
Support comments that were lacking the final IE/Edge version that exhibits
the bug were checked & updated. Links to the Chromium bug tracker were updated.
Code in tests related to unsupported browsers (like Android 2.3 in non-basic
tests) has been removed.

Fixes gh-2868
Closes gh-2949
2016-03-08 23:26:46 +01:00
Richard Gibson
dba93f79c4 CSS: Restore cascade-override behavior in .show
Fixes gh-2654
Fixes gh-2308
Close gh-2810
Ref 86419b10bf
2016-01-13 16:05:09 -05:00
Timmy Willison
cb80b42b91 Effects: add tests for using jQuery.speed directly
Fixes gh-2716
Close gh-2724
2015-11-17 15:11:46 -05:00
Timmy Willison
88046440da Selector: pass jQuery unit tests with selector-native
- Ignore certain tests that obviously are not supported
- Beefed up the sortOrder, uniqueSort, isXMLDoc, and attr functions

Fixes gh-1742
Fixes gh-2048
Close gh-2703
2015-11-11 10:10:10 -05:00
Oleg Gaidarenko
c8d15a2f9f Tests: further improvements QUnit 2.0 migration
* Remove QUnit jshint globals
* Extend QUnit.assert methods
* Use assert.async instead of start/stop/done

Ref b930d14ce6
2015-09-08 04:06:20 +03:00
Thomas Tortorini
3dd3d1357d Effects: Finish should call progress
Fixes gh-2283
Closes gh-2292
2015-09-08 02:40:54 +02:00
Oleg Gaidarenko
10fdad742a Build: Update jscs and lint files
Fixes gh-2056
2015-09-07 20:03:50 +03:00
Oleg Gaidarenko
b930d14ce6 Tests: partially use new qunit interface
http://qunitjs.com/upgrade-guide-2.x/

For most of the boring work was used
https://github.com/apsdehal/qunit-migrate package

However, it can't update local qunit helpers, plus in some places
old QUnit.asyncTest signature is still used

Fixes gh-2540
2015-08-16 09:02:01 +03:00
Oleg Gaidarenko
aabe94edb4 Tests: don't use deprecated argument in test declaration
Closes gh-2507
2015-07-30 20:46:31 +03:00
Michał Gołębiowski
1c59b308d2 Build: Acknowledge Android 2.3 is not ES5-compatible
Android 2.3 chokes on unquoted reserved words being used as property names
which was making Deferred tests not run.

Acknowledge the sad fact that Android 2.3 is not ES5-compliant browser
and enable the "es3" option in JSHint config.

Fixes gh-2478
Closes gh-2481
2015-07-20 18:37:26 +02:00
Corey Frang
cdaed15c7e Effects: Add tests for jQuery.Tween 2015-06-26 20:05:25 -04:00
Timmy Willison
16713fb609 Tests: fix tests in accordance with new :visible behavior 2015-05-12 09:58:55 -04:00
Richard Gibson
86419b10bf CSS: Ignore the CSS cascade in show()/hide()/etc.
Fixes gh-1767
Fixes gh-2071
Closes gh-2180
2015-05-11 13:00:49 -04:00
Timmy Willison
6d7ef56ed3 Effects: add tests for jQuery.easing._default in Animation and Tween
Ref gh-2219
2015-05-05 11:22:40 -07:00
Timmy Willison
5f2ea40258 Effects: set default easing using jQuery.easing._default
Fixes gh-2219
Close gh-2218
2015-05-05 10:24:20 -07:00
Richard Gibson
26276a307c Tests: Minor updates for QUnit 1.16 compatibility
More to come later.

(cherry picked from commit f6f8848fbe)
2014-12-05 12:34:17 -05:00
Michał Gołębiowski
995f70777a Css: Fix the "sanity check" test
The #dl element has 0 height so it's now considered hidden regardless
of its width.
2014-07-28 18:46:31 +02:00
Oleg Gaidarenko
708764f47b Effects: Improve raf logic
* Make animation behave as if jQuery.fx.off = true if document is hidden

* Use cancelAnimationFrame in jQuery.fx.stop

Closes gh-1578
2014-06-16 03:08:46 +04:00
Oleg Gaidarenko
72119e0023 Effects: Reintroduce use of requestAnimationFrame
Same as before, just use don't use prefixes, since they pretty match useless now
and use page visibility API to determine if animation should start.

Also null the requestAnimationFrame attribute in window for tests since
sinon does not provide fake method for it.

Fixes #15147
2014-06-16 03:08:46 +04:00
Oleg Gaidarenko
10024c2582 Effects: Remove needless operations in tests 2014-05-09 04:11:27 +04:00
Oleg Gaidarenko
c34dbf5a8d Effects: Respect display value on inline elements
Take "olddisplay" value into the account

Fixes #14824
Closes gh-1566
Ref 73fe17299a
2014-04-30 17:05:48 +04:00
Richard Gibson
890d441aa5 Effects: Don't overwrite display:none when .hide()ing hidden elements
Fixes #14848
Closes gh-1548
2014-03-20 22:54:38 -04:00
Michał Gołębiowski
b19d4d3450 Ajax, Effects: Disable Chrome 31 workarounds 2014-03-10 14:57:40 +01:00
Michał Gołębiowski
70ac4485f3 Effects: Don't check fill-opacity in Android 2.3, it's not supported 2014-02-13 16:12:06 -08:00
Michał Gołębiowski
95b21c6ec2 Build: Upgrade QUnit to 1.14.0 2014-02-05 15:35:48 +01:00
Michał Gołębiowski
c11becbb69 Tests: Blacklist one effects test in Chrome 31
Chrome 31 reports incorrect offsetWidth on a table cell with fixed width.
This is fixed in Chrome 32 so let’s just skip the failing test in Chrome 31.
See https://code.google.com/p/chromium/issues/detail?id=290399
2014-01-21 12:02:09 +01:00
Dave Methvin
085814474e Effects: First step() call should match :animated selector
Fixes #14623
Closes gh-1473
2014-01-07 16:01:34 -05:00
cjqed
537e9ced61 Tests: Avoid use of QUnit.reset() in tests by splitting them
Fix #14040
Close gh-1457
2013-12-23 17:21:22 -05:00
John Paul
b407bddea2 Effects: Integrate sinon fake timers into tests. Close gh-1377. 2013-11-24 15:22:09 -05:00
Michał Gołębiowski
4b39a82890 Fix #14340. Remove remnants of oldIE from unit tests. Close gh-1425. 2013-11-11 00:43:27 +01:00
Richard Gibson
94ae713344 No ticket: Improve line-height animation test stability 2013-09-17 10:09:08 -04:00
Timmy Willison
73fe17299a Ensure display: inline-block when animating width/height on inline elements. Fixes #14344. 2013-09-10 14:57:14 -05:00
Richard Gibson
83396ba832 Fix #14318: Cherry-pick interrupted animation fix from master ea5c22ec12 2013-08-30 12:39:41 -04:00
Richard Gibson
29903f38af No ticket: improve line-height animation test robustness
(cherry picked from commit 2b6a7b1caf)
2013-08-27 08:38:29 -04:00
Oleg
012bda75f1 Correct typos in the test assertion 2013-08-10 10:49:14 +04:00
Oleg
5bbfa46aba Fix test of #13855 for Opera 12.1 and IE10 2013-08-10 07:47:21 +04:00
Oleg
9214c37bba Improve test stability for #13855 ticket. Close gh-1328. 2013-08-08 09:44:07 -04:00
Oleg
308980ee2a Fix test for #13937 ticket. Close gh-1299 2013-07-01 22:31:01 +04:00
Richard Gibson
6fd5e480c1 Fix #13937: Correctly scope .finish() following multi-element .animate(). Thanks @gnarf37. Close gh-1279.
(cherry picked from commit ae9e05e9f3)
2013-05-28 16:49:48 -04:00
Richard Gibson
26980c6ec9 Fix #13939: Same-unit relative animations
(cherry picked from commit 00231d5d94)
2013-05-26 19:53:58 -04:00
Richard Gibson
d80c6aca18 Ref 3971c2eb: Sync with 1.x-master 2013-05-13 20:37:42 -04:00
Richard Gibson
3971c2ebb2 Fix #13855: line-height animations. Close gh-1265. 2013-05-13 18:17:25 -04:00
Renato Oliveira dos Santos
ea5c22ec12 Fix #13483. Let slideDown() work after stop(). Close gh-1205. 2013-04-16 23:07:39 -04:00