No animation frames on hidden windows.

As an optimization, Firefox does not execute functions passed to requestAnimationFrame when the window is hidden.  This is the case for the panTo tests here that use a map in a hidden iframe.  Since other browsers may follow suit, we just test the fallback setTimeout method of animating on these tests.
This commit is contained in:
Tim Schaub
2012-01-02 22:29:23 -07:00
parent bd4278de4a
commit 3f6e0141a4

View File

@@ -1,7 +1,22 @@
<html>
<head>
<script src="OLLoader.js"></script>
<script type="text/javascript">
<script>
/**
* Because browsers that implement requestAnimationFrame may not execute
* animation functions while a window is not displayed (e.g. in a hidden
* iframe as in these tests), we mask the native implementations here. The
* native requestAnimationFrame functionality is tested in Util.html and
* in PanZoom.html (where a popup is opened before panning). The panTo tests
* here will test the fallback setTimeout implementation for animation.
*/
window.requestAnimationFrame =
window.webkitRequestAnimationFrame =
window.mozRequestAnimationFrame =
window.oRequestAnimationFrame =
window.msRequestAnimationFrame = null;
</script>
<script src="OLLoader.js"></script>
<script type="text/javascript">
var isMozilla = (navigator.userAgent.indexOf("compatible") == -1);
var map;