diff --git a/gfx/src/shared/gfxImageFrame.cpp b/gfx/src/shared/gfxImageFrame.cpp index 24abc1da5e9..1a2fa098987 100644 --- a/gfx/src/shared/gfxImageFrame.cpp +++ b/gfx/src/shared/gfxImageFrame.cpp @@ -401,10 +401,14 @@ NS_IMETHODIMP gfxImageFrame::GetTimeout(PRInt32 *aTimeout) if (!mInitalized) return NS_ERROR_NOT_INITIALIZED; - if (mTimeout == 0) - *aTimeout = 100; // Ensure a minimal time between updates so we don't throttle the UI thread. + // Ensure a minimal time between updates so we don't throttle the UI thread. + // consider 0 == unspecified and make it fast but not too fast. + // 100 is compatible with IE and Opera among others + if (mTimeout >= 0 && mTimeout < 100) + *aTimeout = 100; else *aTimeout = mTimeout; + return NS_OK; } diff --git a/gfx2/src/gfxImageFrame.cpp b/gfx2/src/gfxImageFrame.cpp index 24abc1da5e9..1a2fa098987 100644 --- a/gfx2/src/gfxImageFrame.cpp +++ b/gfx2/src/gfxImageFrame.cpp @@ -401,10 +401,14 @@ NS_IMETHODIMP gfxImageFrame::GetTimeout(PRInt32 *aTimeout) if (!mInitalized) return NS_ERROR_NOT_INITIALIZED; - if (mTimeout == 0) - *aTimeout = 100; // Ensure a minimal time between updates so we don't throttle the UI thread. + // Ensure a minimal time between updates so we don't throttle the UI thread. + // consider 0 == unspecified and make it fast but not too fast. + // 100 is compatible with IE and Opera among others + if (mTimeout >= 0 && mTimeout < 100) + *aTimeout = 100; else *aTimeout = mTimeout; + return NS_OK; } diff --git a/gfx2/src/windows/gfxImageFrameWin.cpp b/gfx2/src/windows/gfxImageFrameWin.cpp index c3235dc2387..acb24bb54f9 100644 --- a/gfx2/src/windows/gfxImageFrameWin.cpp +++ b/gfx2/src/windows/gfxImageFrameWin.cpp @@ -478,8 +478,11 @@ NS_IMETHODIMP gfxImageFrameWin::GetTimeout(PRInt32 *aTimeout) if (!mInitalized) return NS_ERROR_NOT_INITIALIZED; - if (mTimeout == 0) - *aTimeout = 100; // Ensure a minimal time between updates so we don't throttle the UI thread. + // Ensure a minimal time between updates so we don't throttle the UI thread. + // consider 0 == unspecified and make it fast but not too fast + // 100 is compatible with IE and Opera among others + if (mTimeout >= 0 && mTimeout < 100) + *aTimeout = 100; else *aTimeout = mTimeout; return NS_OK; @@ -684,4 +687,4 @@ NS_IMETHODIMP gfxImageFrameWin::GetAlphaDepth(gfx_depth *aDepth) { *aDepth = mAlphaDepth; return NS_OK; -} \ No newline at end of file +}