Closed Bug 1589294 Opened 5 years ago Closed 5 years ago

CSS animation on a children node of a parent element with visibility:hidden, opacity: 0 raises CPU

Categories

(Core :: Layout, enhancement)

70 Branch
Unspecified
Linux
enhancement
Not set
normal

Tracking

()

RESOLVED WORKSFORME
Performance Impact medium
Tracking Status
firefox70 --- affected
firefox71 --- affected

People

(Reporter: karlcow, Unassigned)

References

()

Details

(Keywords: perf:resource-use)

As reported on webcompat

There are invisible animations in the media player making the browser using a lot of CPU even after the video has ended. The issue doesn't reproduce in Chromium. I'm reporting it here instead of Bugzilla because the site shouldn't have such hidden animations anyway.

  1. Go to https://old.reddit.com/r/dataisbeautiful/comments/cxuah9/usage_share_of_internet_browsers_1996_2019_oc/
  2. Stop the video
  3. Check the CPU

Actual:
CPU is high

Expected:
CPU is low, nothing is visibly moving on the page.

And that's basically the issue. There are 4 animations in the page constantly running.

Their parent element is set with visibility: hidden and opacity: 0, instead of display:none. It has the impact that they constantly run and make the CPU high. I don't know if there is a way to optimize this without creating secondary issue.

setting [qf] for performance.

Chrome maintains a low CPU.

This is a case that we don't properly detect the element in question is in visibility:hidden tree. Without debugging I have no idea why.

Blocks: 1237454
Whiteboard: [qf] → [qf:p2:resource]

Can somebody try with the latest nightly? Emilio fixed the case where animation in opacity:0 subtree in bug 1427033.

Can, can you test? (See Comment #2)

Flags: needinfo?(kdubost)
  • 78.0a1 (2020-05-07) (64-bit) CPU is low
  • 75.0 (64-bit) CPU is low

so no crazy changes for this specific page.
https://old.reddit.com/r/dataisbeautiful/comments/cxuah9/usage_share_of_internet_browsers_1996_2019_oc/

So this is fixed on this page, but not sure why.

Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(kdubost)
Resolution: --- → FIXED

Thank you Karl! Then I am pretty sure bug 1427033 fixed this. :)

Depends on: 1427033
Performance Impact: --- → P2
Whiteboard: [qf:p2:resource]
Resolution: FIXED → WORKSFORME
You need to log in before you can comment on or make changes to this bug.