VOOZH about

URL: https://bugzilla.mozilla.org/show_bug.cgi?id=876032

⇱ 876032 - Javascript animation slows down when tab loses focus


Closed Bug 876032 Opened 13 years ago Closed 13 years ago

Javascript animation slows down when tab loses focus

Javascript animation slows down when tab loses focus
Core
DOM: Core & HTML
17 Branch
x86
Windows 7
defect
Not set
normal
Points:
---
RESOLVED WONTFIX
RESOLVED
WONTFIX
Iteration:
---
a11y-review
Accessibility Severity
Performance Impact
Size Estimate
Webcompat Priority
Webcompat Score
Tracking Status
relnote-firefox
thunderbird_esr115
thunderbird_esr140
firefox-esr115
firefox-esr140
firefox-esr153
firefox152
firefox153
firefox154
---
QA Whiteboard:
---
Has STR:
---
Change Request:
---
Bug Flags:
Signature:
None
This bug is publicly visible.

 
Reporter

Description

13 years ago
Attached file test.html (obsolete) — Details
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20100101 Firefox/21.0 (Beta/Release) Build ID: 20130511120803 Steps to reproduce: (1) Load the attached test case in tab 1 (2) Click the Start button (3) A popup opens in which a counter is displayed. The counter counts up. (4) Move the popup to a location where it will not be obscured by the main browser window (5) In the main browser window, select a different tab, i.e. a tab other than tab 1. Actual results: The counting up slows down radically. Expected results: The counting should continue at the same speed.
Reporter

Comment 1

13 years ago
Possible duplicate of bug 665000 though I thought the behaviour changed more recently than that.
Summary: Javascript animation slows down when window loses focus → Javascript animation slows down when tab loses focus
Reporter

Comment 2

13 years ago
Attached file Test caseDetails
Attachment #754007 - Attachment is obsolete: true
Reporter

Updated

13 years ago
Attachment #754011 - Attachment mime type: text/plain → text/html
Reporter

Comment 3

13 years ago
Hmmm I think this must be by design, the behaviour seems to be controlled by dom.min_background_timeout_value. Set that to a low value and the animation works OK even in a background tab. This is a bit annoying - impacts some code I have that uses Neil Mix's threading library which is based on setTimeout (http://www.neilmix.com/2007/02/07/threading-in-javascript-17/). Start some javascript running and go off to another tab and the javascript slows to a crawl.
This is very much purposeful: we throttle timeouts in background tabs to a 1000ms minimum (compared to 4ms minimum for foreground tabs), to keep them from chewing up CPU. And yes, bug 665000 is about pretty much the same issue. Note that other UAs have the same behavior at this point, for similar reasons.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.