mediawiki.requestIdleCallback: Improve documentation
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 21 Dec 2016 05:13:48 +0000 (21:13 -0800)
committerKrinkle <krinklemail@gmail.com>
Wed, 21 Dec 2016 06:01:14 +0000 (06:01 +0000)
commit611a0c8452f51398daa722c5cb6781482c9550ec
treed82dc5091e70c23589c8d708df4a762f8023e377
parent0cd77f4a42cbbe04efd969d4ac9cab17e25a3e56
mediawiki.requestIdleCallback: Improve documentation

* Explain basic logic.
* Document the 'options.timeout' parameter of the native interface.
  The fallback shim ignores this parameter because it always executes
  callbacks using setTimeout(,1), which is before any timeout would
  expire. The native requestIdleCallback is smarter about scheduling
  callbacks at moments in time when no other priority things happen,
  at which point the timeout helps inform how long to wait at most
  for an idle period to naturally occur.

Change-Id: I45126b875547f64ec8b450a264b250260c41084c
resources/src/mediawiki/mediawiki.requestIdleCallback.js