Oleg Gaidarenko [Mon, 6 Mar 2017 01:06:10 +0000 (02:06 +0100)]
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.
Richard Gibson [Mon, 16 Jan 2017 18:18:49 +0000 (10:18 -0800)]
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
Node.js 0.12 is no longer supported by upstream. So far we had to keep
a workaround that would skip running ESLint there (or even load its task)
as it no longer supports Node.js <4; the same applied to Node smoke tests
as jsdom has also dropped support for those old Node versions. Those
workarounds have been removed now.
1. Use the short name of the preset in the config.
2. Run ESLint first on non-minified files.
3. Explicitly specify environments in every config file (those settings cascade
which means we've been assuming a Node.js environment where we shouldn't have).
The code replacing @CODE in wrapper.js was written so that it expected
both the code and the next line to start in the first column. This commit
adjusts the regex so to get rid of that assumption and to work properly
regardless of number of lines with comments after this block.
While this is technically not necessary for our code, contributors sometimes
re-format the wrapper file in their pull requests and the error
messages they get don't tell them what's the real problem with their code.
Docs: Remove supported jQuery versions from ISSUE_TEMPLATE.md
We no longer support jQuery 1.x/2.x and mentioning 3.x would just mean the text
gets out of date once we release jQuery 4. We only really support the latest
jQuery version so let's make that clear.
Core: rnotwhite -> rhtmlnotwhite and jQuery.trim -> stripAndCollapse
- Renames and changes rnotwhite to focus on HTML whitespace chars
- Change internal use of jQuery.trim to more accurate strip and collapse
- Adds tests to ensure HTML space characters are retained where valid
- Doesn't add tests where the difference is inconsequential and
existing tests are adequate.
Build: Update promises-aplus-tests for compat with Node 7
The older promises-aplus-tests was relying on old Mocha that, in turn,
used an obsolete graceful-fs version that is not guaranteed to work fine
with the upcoming Node 7 and later.
Tests: Disable a whitespace-setting test in Edge 14
Working around this problem would require us to skip setting whitespace-only
values except when they're valid which would be very fragile. Another option
would be to set the value and see if it succeeded and then react to that.
We've tried something like that in the past to be able to overwrite !important
styles (see 24e5879) but it broke the CSS cascade (see
https://bugs.jquery.com/ticket/14836#comment:5) and was triggering
MutationObserver callbacks too often so it was reverted in PR gh-1532.
Timmy Willison [Mon, 15 Aug 2016 15:41:11 +0000 (11:41 -0400)]
Core: expose noConflict in AMD mode
- For compability reasons, we had already added the global
in AMD mode, but without noConflict. This adds back noConflict
to AMD (which fixes noConflict mode in the tests).