Closed Bug 597893 Opened 14 years ago Closed 2 years ago

Use animation-scheduling API for <marquee> scrolling

Categories

(Core :: Layout, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mwu, Unassigned)

References

Details

(Keywords: perf)

Attachments

(3 files)

This makes pages that use many <marquee>s behave better and use less cpu when the page isn't the active tab. One page (with 50 marquees) that pegs my CPU at ~95% drops to 15-20% with this patch when switching away from that tab. Without this patch, that tab continues to peg the CPU.
Attachment #476679 - Flags: review?(roc)
Attachment #476679 - Flags: review?(roc) → review?(martijn.martijn)
The patch seems to stop marquees entirely in background tabs. Is that what we want to happen. That's not what IE8 is doing.
Attached file testcase1
This gives an alert when the marquee bounces. That doesn't happen with the patch in a background tab.
Also with the patch, when the file is loaded, then the window is minimized, the alert fires, but then the alert isn't displayed. I guess that might be a bug in the animation-scheduling api.
Attached file testcase2
With the patch, the marquee in the testcase doesn't run. It does work fine in builds without the patch and in IE8.
One of the goals of the animation scheduling api was being able to throttle animations in background tabs. I think one option was to fire the animation once per second. Don't know if that was implemented but it sounds like it may have been. We can make this code a bit smarter and skip a bunch of steps if the time since the last animation was too long, and fire events as necessary.
We should be firing mozRequestAnimationFrame once per second in background tabs. Is that not happening?
Attachment #476679 - Flags: review?(martijn.martijn)
See Also: → 306344

The bug assignee didn't login in Bugzilla in the last 7 months.
:dholbert, could you have a look please?
For more information, please visit auto_nag documentation.

Assignee: mwu.code → nobody
Flags: needinfo?(dholbert)

The problem described in comment 0 is no longer an issue. Coincidentally I (and others) just looked at a case of this in bug 1754868, and we confirmed (in performance profiles) that marquees in background tabs take no CPU.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(dholbert)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: